Send and receive QueryString values in Asp.Net

Querystring is used to transfer information from one page to another. It is the most commonly used way to transfer information between pages. Let’s see how we can send and receive QueryString in ASP.NET.

Sending QueryString

Response.Redirect("Home.aspx?UserId=110");

Receiving QueryString

int UserID = 0;
if (Request.QueryString["UserId"] != null)
{
  int.TryParse(Request.QueryString["UserId"], out UserID);

}

Comments

Popular posts from this blog

Check if ViewBag is null or doesn't exist

Using Progress Bar In C#

Jquery serer side datatables in asp.net