Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing parameters in sqldatasource form parameters

Status
Not open for further replies.

nastenka

Programmer
Oct 25, 2006
8
US
I have following code, how do I pass parameters from text box to the form parameters in sqldatasource?

<form id="Form1" action="Report.aspx" method=post target=_blank>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <br />
<asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox> <br />
<asp:HyperLink ID="Submit1" NavigateUrl="Report.aspx" runat="server" Text="Submit" ></asp:HyperLink> <br />
</form>

What do I need to change in code above to link it to code below? what are the features that allow passing session variables in the text box? If textbox is not able to pass session variables, then what does?


<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings %>"
SelectCommand="ReportST" SelectCommandType="StoredProcedure"
>
<SelectParameters>
<asp:FormParameter DefaultValue="1/1/05" FormField="beginningdate" Name="BeginningDate" Type="DateTime" />
<asp:FormParameter DefaultValue="31/12/05" FormField="endingdate" Name="EndingDate" Type="DateTime" />
</SelectParameters>
 
forum855 please. This is Classic ASP

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top