Querystring is used to pass a small chunk of data between aspx pages. One page can pass a value and on the other page can capture it. Using query is limited. you can not pass a dataset, or array. If you want to pass complex objects use session. But you can
pass multiple values at once.
I want to understand the query string concept and how to use it in the web pages..
If anyone can provide examples of query string it will be very helpful
Bro....i would advise you to first try Google....there are tonnes of articles sitting out there in web....I know how does it feel for a newbie when investigating about a new concept....but it can save you hell a lot of time when you just type "querystring
asp.net" in google search box instead of writing a complete post here and waiting for replies....
PS - if you find anything difficult in understanding the concept of QueryString then better post where you are finding it difficult...
rohitpundlik
Contributor
3102 Points
934 Posts
How to use Query String
Apr 18, 2010 01:54 AM|LINK
Hi All,
I want to understand the query string concept and how to use it in the web pages..
If anyone can provide examples of query string it will be very helpful
Rohit Pundlik
Please mark as answer if this helps you...
dkurian
Member
37 Points
19 Posts
Re: How to use Query String
Apr 18, 2010 02:29 AM|LINK
<p> Hi,
Please refer the page: http://codeproject.com/KB/aspnet/QueryString.aspx
This should give you a start.
</p>
Das.Sandeep
Star
10652 Points
1897 Posts
Re: How to use Query String
Apr 18, 2010 03:51 AM|LINK
I am clicking above link it throws error may be link was not corrected even text is correct. Please check below
http://www.codeproject.com/KB/aspnet/QueryString.aspx
http://www.dotnetspider.com/resources/29911-How-use-Query-string-asp-net.aspx
http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring.aspx
Please give us feedback no matter whether you get your answer.
Please "Mark as Answer" if it's useful for you.
Regards,
Sandeep
sreejukg
All-Star
27543 Points
4109 Posts
Re: How to use Query String
Apr 18, 2010 03:58 AM|LINK
to understand query string - go here http://www.whatisaquerystring.com/
To understand how asp.net and querystring together - http://dotnetperls.com/querystring-net
hope this helps
My Blog
cnranasinghe
Star
8885 Points
1798 Posts
Re: How to use Query String
Apr 18, 2010 04:02 AM|LINK
Hi
Querystring is used to pass a small chunk of data between aspx pages. One page can pass a value and on the other page can capture it. Using query is limited. you can not pass a dataset, or array. If you want to pass complex objects use session. But you can pass multiple values at once.
private void btnSubmit_Click(object sender, System.EventArgs e)
{
Response.Redirect("Page1.aspx?MyName=" +txtMyName.Text + "&Age=" + txtAge.Text);
}
"&" use to seperate multiple variables. After submitting check the URL and you can see the values.
on load event of page2 write following to capture the variable values
private void Page2_Load(object sender, System.EventArgs e)
{
txtMyName.Text = Request.QueryString["MyName"];
txtAge.Text = Request.QueryString["Age"];
}
manoj0682
Star
8479 Points
1499 Posts
Re: How to use Query String
Apr 18, 2010 04:48 AM|LINK
http://www.codeproject.com/KB/aspnet/QueryString.aspx
http://dotnetperls.com/querystring-net
Manoj Karkera
ramiramilu
All-Star
95413 Points
14106 Posts
Re: How to use Query String
Apr 18, 2010 06:34 AM|LINK
Bro....i would advise you to first try Google....there are tonnes of articles sitting out there in web....I know how does it feel for a newbie when investigating about a new concept....but it can save you hell a lot of time when you just type "querystring asp.net" in google search box instead of writing a complete post here and waiting for replies....
PS - if you find anything difficult in understanding the concept of QueryString then better post where you are finding it difficult...
JumpStart
arefinn
Contributor
4992 Points
750 Posts
Re: How to use Query String
Apr 18, 2010 08:00 AM|LINK
See the following thread :
http://forums.asp.net/t/1548246.aspx
see the problem there and also see my reply there...Its a small example but you will get good idea on how to use querystrings
jsd24
Participant
1380 Points
255 Posts
Re: How to use Query String
Apr 19, 2010 04:30 AM|LINK
If Your Page URL Like www.xyz.com?UID=1&PID=2
then you can use this in your page like
int intUID = 0;
int intPID = 0;
if (Request.QueryString["UID"] != null && Request.QueryString["UID"].ToString()!="")
{
intUID = int.Parse( Request.QueryString["UID"] );
}
Same way for intPID
My Blog : http://jsdideas.blogspot.com
prafullabora...
Member
319 Points
142 Posts
Re: How to use Query String
Apr 19, 2010 04:51 AM|LINK
HI
use this
>asp:linkButton ID="ln" runat="Server" PostBackUrl="Vehicle.add?ID=Eval("VEhi_Id")">
Prafulla A. Borade.