how exactly does request.querystring work? I have a datagrid and a select button on it that is holding another ID. What I want to do is carry another ID to the next page so I tried to do a request.querystring but its not passing it. So I'm not sure if what
I need to do is right or if there is another way.
You need to have data in your query string. So your select button has to pass something in the qs. Such as response.redirect(whatever.aspx?var=foo) the QS has a variable called var which contains foo data. You have to manually assign variables to the QS.
In this world there are 10 types of people, those that know binary and those who don't.
Hi, If the ID you are passing is not any confidential parameter than you can always use Response.Redirect to send the values and Request.QueryString to catch them on other pages. If its confidential ID you can use Session Variables that are made on the Server
Side.
You do not make assignments to Request.QueryString (or anything in Request for that matter, since you're "requesting" it). To add to the querystring of any page, add a querystring to links: mypage.aspx
<- no querystring mypage.aspx?i=1 <- querystring - "i" defined mypage.aspx?i=
<- querystring - "i" defined (no value though) mypage.aspx?i=3&x=1 <- querystring - "x" defined and "i" defined mypage.aspx?x
<- querystring - no variables defined (not even x--"=" is required) To get at the querystring variables (always considered STRING values):
string x = Request.QueryString["x"];
if ( x == null )
// link/user didn't put x= in the querystring
Dim x As String = Request.QueryString("x")
If x Is Nothing Then
' link/user didn't put x= in the querystring
End If
Hello, I would recommend you check this article, as I understood from your question, is that you need to create a master/detail webform.
Master/Detail With DG. I am sure it will help you out. regards.
You can use as many as you want until the URL is no longer valid. Last I knew URLs bombed at more than 256 characters. When you reply to this thread look at the URL. http://www.asp.net/Forums/AddPost.aspx?tabindex=1&PostID=675849&mode=flat
etg1103
Participant
905 Points
189 Posts
request.querystring
Aug 20, 2004 06:03 PM|LINK
Optik
Contributor
5430 Points
1106 Posts
Re: request.querystring
Aug 20, 2004 06:27 PM|LINK
nothinbut.NE...
Member
685 Points
138 Posts
Re: request.querystring
Aug 20, 2004 06:28 PM|LINK
azamsharp
All-Star
24614 Points
4612 Posts
Re: request.querystring
Aug 20, 2004 08:53 PM|LINK
HighOnCoding
pickyh3d
Star
9696 Points
1955 Posts
Re: request.querystring
Aug 21, 2004 05:23 AM|LINK
string x = Request.QueryString["x"]; if ( x == null ) // link/user didn't put x= in the querystring Dim x As String = Request.QueryString("x") If x Is Nothing Then ' link/user didn't put x= in the querystring End Ifhaidar_bilal
All-Star
45609 Points
8730 Posts
MVP
Re: request.querystring
Aug 21, 2004 12:53 PM|LINK
Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB
Red Baron
Member
125 Points
25 Posts
Re: request.querystring
Aug 25, 2004 03:42 PM|LINK
uncleb
Star
9644 Points
1864 Posts
Re: request.querystring
Aug 25, 2004 07:40 PM|LINK
All that wander, are not lost...
What were we talkin bout
JakeJeck
Contributor
4750 Points
950 Posts
Re: request.querystring
Aug 25, 2004 07:56 PM|LINK
request.querystring("tabindex") request.querystring("PostID") request.querystring("mode")tje.gaab
Member
30 Points
46 Posts
Re: request.querystring
Feb 27, 2008 01:07 PM|LINK
Hi
Have a little question to this.
The help in VS2005 tells me the same at JakeJeck.
But when I try to read the variable i get this error: 'System.Web.HttpRequest.QueryString' is a 'property' but is used like a 'method'
I try like this: string sTest = Request.QueryString("showBtn1");
If I try like this I can build it, but I only gets "null" in the stringvariable sTest: string sTest = Request.QueryString["showBtn1"];
Any suggestion, how I can make it work?
//Thomas