Query String in asp.net
Query String is used to transfer the data to another page by redirecting.Redirect Query String
Response.Redirect("aspxPage.aspx?parameter=" + TextBox1.Text);
Receive the Query String Value
string sQueryStringVal = Request.QueryString["parameter"];
Send and Receive a Query String using Hyperlink
SEND a Query String using Hyperlink
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default2.aspx?Id={0}">Link
</asp:HyperLink>
HyperLink1.NavigateUrl = string.Format(HyperLink1.NavigateUrl, TextBox1.Text);
Receive a Query String using Hyperlink
string sQueryStringVal = Request.QueryString["Id"];
Pass a Query String using Hyperlink inside the Grid View
- <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/Default2.aspx?Id="+Eval("columnName")%>'>Link</asp:HyperLink>
</asp:HyperLink>