In this article I will explain how to pass multiple parameters in query string or url in asp.net using C# and VB.NET.
In Previous posts I explained Send Gridview as Email Body, Dynamically display meta tags in asp.net, Differences between appsettings and connection strings and many articles relating to Asp.net, Gridview, SQL Server, Ajax, JavaScript etc. Now I will explain how to pass multiple parameters in url in asp.net using C# and VB.NET.
protected void
btnSend_Click(object sender, EventArgs e)
{
Response.Redirect("Default2.aspx?UserId="+txtUserId.Text+"&UserName="+txtUserName.Text);
}
|
protected void
Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
lblUserId.Text = Request.QueryString["UserId"];
lblUserName.Text = Request.QueryString["UserName"];
}
}
|
protected void
Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
lblUserId.Text = Request.QueryString[0];
lblUserName.Text = Request.QueryString[1];
}
}
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
|
Subscribe by RSS
Subscribe by Email
1 comments :
plz sir provide a tutorial on urlrewwriter.net