Querystring is a
way to passing data from one page to another page through the URL. We can pass
value through querystring parameter which will append at the end of a page URL.
Data is visible in url. This is the main drawback of this method of passing the
value. But we can protect the data by encryption.
Example:
In asp.net we send
data as:
Response.Redirect("webform2.aspx?bname="+txtname.Text);
And receive value as:
lblbname.Text = Request.QueryString["bname"];
In Url it will look like:
http://localhost:6058/webform2.aspx?bname=5
Advantages:
1. It is supported
by all browsers.
2. Querystring is
easy to use.
3. Server resources
are not required.
4. Extra afford are
not needed to code.
Disadvantages:
1. All information
is visible to user. Therefore, it is not secure.
2. There is a limit
to URL length of 255 characters.
0 comments:
Post a Comment