String should have a lowercase "s". I don't know if that's your problem, though. C# is case-sensitive and there is a difference between "String" and "string". "string" is for assigning a variable. Not sure what "String" is the keyword for, but it always
gave me problems, so I avoided it. "string" is dark-blue in Visual Studio, "String" is aqua, like a class name or something.
e_screw
All-Star
19530 Points
3894 Posts
Re: How to get parameter in url ( by C# for .net)
Feb 13, 2007 09:18 AM|LINK
This line of code String a= Request.QueryString["cid"].ToString(); is in news_c.aspx page right?
keep a break point on the Page_Load of news_c.aspx and check, and sure it will hit. Once hit, use F11, to execute line by line.
Thanks
Electronic Screw
Website||Blog||Dub@i.net
jcjcjc
Member
64 Points
639 Posts
Re: How to get parameter in url ( by C# for .net)
Feb 13, 2007 09:26 AM|LINK
thank you..
yes, This line of code String a= Request.QueryString["cid"].ToString(); is in news_c.aspx page is in news_c.aspx
break point on the Page_load of news_c.aspx is not be hit...
should I change other attribute or something else to correct this problem?
thank you again
e_screw
All-Star
19530 Points
3894 Posts
Re: How to get parameter in url ( by C# for .net)
Feb 13, 2007 10:10 AM|LINK
BreakPoint on Page_Load of news_c.aspx should hit, else your page is not loading.
Thanks
Electronic Screw
Website||Blog||Dub@i.net
jcjcjc
Member
64 Points
639 Posts
Re: How to get parameter in url ( by C# for .net)
Feb 14, 2007 12:31 AM|LINK
I guess the problem is page not loading....
do you know what will cause this kind of problem? and how to correct it please?
thank you very much
jcjcjc
Member
64 Points
639 Posts
Re: How to get parameter in url ( by C# for .net)
Feb 14, 2007 02:20 AM|LINK
I don't know how come it didn't run Page_load.. [:S]
but my problem now is resolve... a little bit weird ...
navyjax2
Member
88 Points
45 Posts
Re: How to get parameter in url ( by C# for .net)
Oct 11, 2008 01:16 AM|LINK
String should have a lowercase "s". I don't know if that's your problem, though. C# is case-sensitive and there is a difference between "String" and "string". "string" is for assigning a variable. Not sure what "String" is the keyword for, but it always gave me problems, so I avoided it. "string" is dark-blue in Visual Studio, "String" is aqua, like a class name or something.
fanette48
Member
6 Points
5 Posts
Re: How to get parameter in url ( by C# for .net)
Jun 30, 2010 06:59 PM|LINK
thanks, that was helpful for me in VB.net. This code works :
1st page : in a gridview, this adds a column where you with "select" hyperlink. The links sends you to another passing the appID of the row selected
<asp:HyperLinkField DataNavigateUrlFields="AppID" DataNavigateUrlFormatString="~/Default2.aspx?AppID={0}" Text="Select" />
2nd page : prints the parameter into the web page.
<%Response.Write("" & Request.QueryString("AppID"))%>
or to save it in a variable :
Dim AppID As String = Request.QueryString("AppID")%>
<% Response.Write("" & AppID)%>
vb.net url parameter
fanette48
Member
6 Points
5 Posts
Re: How to get parameter in url ( by C# for .net)
Jun 30, 2010 06:59 PM|LINK
thanks, that was helpful for me in VB.net. This code works :
1st page : in a gridview, this adds a column with "select" hyperlinks. The links sends you to another page passing the appID of the row selected
<asp:HyperLinkField DataNavigateUrlFields="AppID" DataNavigateUrlFormatString="~/Default2.aspx?AppID={0}" Text="Select" />
2nd page : prints the parameter into the web page.
<%Response.Write(
"" & Request.QueryString("AppID"))%>
or to save it in a variable :
Dim AppID As String = Request.QueryString("AppID")%>
<% Response.Write(
"" & AppID)%>
vb.net url parameter asp