Hi,
I am new to ASP.net.
How do I capture the values of a form which submits to a different page, my code looks something like below:
The form is in default.aspx page and it submits to search-results.aspx page.
<form id="form1" runat="server">
<asp:TextBox ID="txtKeyword" runat="server" CssClass="TextBox" ForeColor="#CCCCCC" MaxLength="150" Width="240px"></asp:TextBox>
<asp:DropDownList ID="intSaleRental" runat="server" CssClass="TextBox">
<asp:ListItem Value=0 Selected="True">Property Type</asp:ListItem>
<asp:ListItem Value=1>For Sale</asp:ListItem>
<asp:ListItem Value=2>For Rent</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" PostBackUrl="~/search-results.aspx" CssClass="Button" Text="Submit" Font-Size="7pt" Height="20px" />
</form>
On search-results.aspx page I try to get the values using:
string txtKeyword = Request.Form ("txtKeyword");
string intSaleRental= Request.Form ("intSaleRental");
But I get null values.
When I view the source code in browse it shows “c00lt” as prefix of textbox and dropdown listbox names.
Please advice.