Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 7 of 7

Thread: Embedding a contact page/modifying to do db lookup

  1. #1
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default Embedding a contact page/modifying to do db lookup

    Hello,
    FYI:Very new to aspdotnetstorefront; not new to .NET.

    Which way should I go with the following:

    Need: the Contact page to look up the sender's email given and if it's an existing subscriber to an eBook, flag the email so the owner knows this.

    q?-Would I create/embed a custom aspx page and if so, how-? --links appreciated
    q?-Can I copy/paste/rename/modify a new XMLPackage and modify an existing aspdnsf file somewhere in some way to handle all this?

    (NOTE: must still look up email/user in the DB to verify subscription rather than just see if the user is logged in and use creds.)

  2. #2
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default

    bump........

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    If you're not new to .Net as you say, then you ought to go down the custom aspx page with an aspx C# code behind page. If your pagename was called requestcatalog.aspx you might have the following as a starter for your requestcatalog.aspx.cs file:

    Code:
    using System;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.Data;
    using System.Globalization;
    using AspDotNetStorefrontCore;
    using System.Data.SqlClient;
    
    namespace AspDotNetStorefront
    {
    	public partial class requestcatalog : SkinBase
    	{
    		protected void Page_Load(object sender, System.EventArgs e)
    		{
    		}
    	}
    }
    And your requestcatalog.aspx page might start like this:

    Code:
    <%@ Page language="c#" Inherits="AspDotNetStorefront.requestcatalog" Title="fsdf" CodeFile="requestcatalog.aspx.cs" %>
    <%@ Register TagPrefix="aspdnsf" TagName="XmlPackage" src="XmlPackageControl.ascx" %>
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  4. #4
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default great start

    Thanks! that's a great start for me. but...
    Problems:
    How to 'wire' this all up
    I have been reading this post @ http://forums.aspdotnetstorefront.co...n-Contact-Page
    And it tells me a lot.. however, I don't need all the extras that are on this. Just a simple way of looking up the users email. I know how to do this in .NET, but using the aspdnsf internals is more ideal.

    Example:
    consider this portion--
    Code:
     if (ThisCustomer.IsRegistered)
                    {
                        MailName.Text = ThisCustomer.FirstName + " " + ThisCustomer.LastName;
                        MailPhone.Text = ThisCustomer.Phone;
                        MailEmail.Text = ThisCustomer.EMail;
                    }
    ThisCustomer? Is that a default object?
    (so much to learn here. Frustrated...And these forums/tutes don't really explain any nuts/bolts just the admin side with clicking the admin interface... hard to learn this stuff.)

    Anyway, if you could help me flesh this out, I'd greatly appreciate it. Especially since it's due today and I only started last Wed... Even if we can use the link above and modify it to only do what I need, that'd be great.

    What to use to lookup email in DB? regular .NET?
    What defaults for a db conn can I use from the appConfigs?
    or something special in aspdnsf code can do this?

  5. #5
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    If the customer is registered and logged in then ThisCustomer.Email will give you their email address.

    If you are using the other thread's example then in the contactus.aspx.vb code-behind file in the SubmitButton_Click method you'll find where they get the mail address using:

    Code:
    Dim SendFrom As String = CommonLogic.FormCanBeDangerousContent("MailEmail")
    After you get SendFrom you can use this to enquire in the db by using this:

    Code:
    int myCustomerID = 0;
    myCustomerID = DB.GetSqlN("SELECT TOP 1 CustomerID AS [N] FROM [Customer] WHERE [Email]='" + SendFrom + "'");
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  6. #6
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default fabs..

    Thanks again so much.
    Quick q: where's the subscription info held in teh DB for a customer?
    (I need to check the exp date for the subscription and make sure it's after today's date.)

    All this help is fabs, thanks!

  7. #7
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default

    Can I use just use this:
    Code:
    int myCustomerID = 0;
    myCustomerID = DB.GetSqlN("SELECT TOP 1 CustomerID AS [N] FROM [Customer] WHERE [Email]='" + SendFrom + "'");
    somehow in the contact topic itself? I'd like to get more savvy with aspdnsf as I will be using it for my new job a lot. Is there a way to accomplish this via aspdnsf methodologies rather than a custom .NET page in general?
    Everything you've helped me with so far is great, I am just wondering if there's a 'simpler' way involving the aspdnsf interface/XML packages/settings/AppConfigs.. etc...