Query string is a simple way to pass some information from one page to another. The information cab be easily pass to one page to another or to same page. With query string method the information passed in url of page request.
- What is QueryString?
- Why do we use QueryString?
- How to pass the values through QueryString?
- How to retrieve the values from QueryString?
This method many browsers supports only 255 character length of url in query string. The value passed will be visible so some time it cause security issue.
Query string consist of two parts (field and value), and each of pair separated by ampersand (&).
Query strings are visible to the user, hence should not be used to send sensitive information (Like Username, Password), unless encrypted.
To retrieve the query string value, use Request object’s QueryString property
Step 1: In Form1 we can write the following code in button event
Step 2 : In Form2 we can retrieve the values of the first page to second page using the Url above this code can write page load event of second page
label1.Text = Request.QueryString[“name”];
Now run project and see output
- Auto Refresh Partial View in ASP.NET MVC
- What is ASP.NET Core
- Difference between TempData keep() And Peek() in Asp.Net MVC
- Difference between viewbag,viewdata and tempdata in asp.net mvc
- ASP.NET MVC With AngularJS
- Retrieving Data Using Form Collection and Inserting Into ASP.Net MVC
- MVC CRUD Operations Using Entity Framework
- Search Functionality in ASP.NET MVC
- How to create a User Registration page using asp.net mvc
- Store Multiple Checkbox state from cookie using Jquery
- Cascading Dropdownlist using Ajax in Asp.Net Mvc with city state country
- Insert, Update, Delete In GridView Using ASP.Net C#
- Binding Dropdownlist With Database In Asp.Net MVC
- Search and Filter data in Gridview using Asp.net MVC
- Select Insert, Update And Delete With ASP.NET MVC
- Display Data in GridView Using Asp.net MVC
- Validation in ASP.NET MVC Razor view
- CRUD Operation Using 3-Tier Architecture In ASP.NET
- How to get Connection String from Web.Config in Asp.Net C#
- Login page using 3-Tier Architecture in ASP.Net
- Asp.Net Image Upload in 3-Tier Architecture and store in sql database