Query string is used to pass values from a page to another page. It’s a part of Uniform Resource Locator (URL) which contains the passing values.

Coding for Button Control on Source.aspx page

   protected void Button1_Click(object sender, EventArgs e)
        Response.Redirect("Target.aspx?Textboxvalue="+  TextBox1.Text);

Query String in ASP.NET

Coding on Target.aspx page

 protected void Page_Load(object sender, EventArgs e)
        Label2 .Text  = Request.QueryString["Textboxvalue"].ToString();

Query String in ASP.NET

  Modified On Sep-07-2019 12:12:14 AM
  1. anil babu
    What is URL REDIRECTION?How can i use this concept in my .net?
    my task is i have generated one url like this "http://example.com/"
    I am passing one pearameter like "http://example.com/Empno=1"
    I want to display Ename in Database table that corresponding "Empno"
    plz Help me Give me one simple example

    I am new this concepts
    plz Help me send source code to my mailID:mandla.anilbabu@gmail.com

Leave Comment