0

So on my IssueRequest.aspx page I have a form that the customer can fillout that issues a work request to my company. However, I need to make sure that they filled out their account info which by default upon account creation equals "" in each field.

I have the following fields

Customer_ID // Auto Number
Customer__First_Name // text field size 50
Customer__Last_Name  // text field size 50
Customer_Address     // text field size 50
Customer_City        // text field size 50
Customer_State       // text field size 50
Customer_Zip         // text field size 50
Customer_Phone       // text field size 50
Customer_Email       // text field size 50

Now I made a sqldatasource named CustomerInformationValidation which gets the userID from the session (set at login) which I would like to run upon load or prerendercomplete but I cannot seem to get it to work.

<asp:SqlDataSource ID="CustomerInformationValidation"  runat="server" 
        ConnectionString="<%$ ConnectionStrings:HandyManTaylorConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:HandyManTaylorConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Customer__First_Name] AS Customer_First_Name, [Customer_Last_Name], [Customer_Address], [Customer_City], [Customer_State], [Customer_Zip], [Customer_Phone], [Customer_Email] FROM [Customer] WHERE ([Customer_ID] = ?)">
        <SelectParameters>
            <asp:SessionParameter Name="Customer_ID" SessionField="userID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

could anyone tell me how to do this?

Neth Munson
  • 57
  • 1
  • 8

1 Answers1

0

It is not very clear of what you are trying to do exactly. I am assuming you want to populate your form fields with data from database. If it is so, you can do it on Selected event of SqlDataSource

<asp:SqlDataSource OnSelected="CustomerInformationValidation_Selected" ....

In code behind handle this event and load data

protected void CustomerInformationValidation_Selected(Object source, SqlDataSourceStatusEventArgs e) 
{

}

Why are you using SqlDataSource? It has a benefit when you bind it to data control. If you are not binding it, you might want to use standard ADO.NET select which is very simple.

fenix2222
  • 4,602
  • 4
  • 33
  • 56
  • i want to prevent them from being able to press submit on my issue request form if they havent filled out their account info so I figured id use a select query and if their info = "" then disable the submit button – Neth Munson Jun 18 '12 at 02:07
  • i want to prevent them from being able to press submit on my issue request form if they havent filled out their account info so I figured id use a select query and if their info = "" then disable the submit button – Neth Munson Jun 18 '12 at 02:08
  • Why dont you just add to stop submits – fenix2222 Jun 18 '12 at 02:08
  • Can I do that even though the data I need to validate is in another table /slash/ a different aspx page? – Neth Munson Jun 20 '12 at 20:34