Query String Weirdness
-
The following code,
PageDetails.Request.QueryString.ToString()
Returns the following. NewsID=66NewsID=66 Any ideas anyone? -
The following code,
PageDetails.Request.QueryString.ToString()
Returns the following. NewsID=66NewsID=66 Any ideas anyone?I take it the newsId only appears in there once ? Why are you calling ToString ?
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
The following code,
PageDetails.Request.QueryString.ToString()
Returns the following. NewsID=66NewsID=66 Any ideas anyone?Calling the
ToString()
method will return a string representation ofQueryString
which is aNameValueCollection
. I would guess that you have passed the same parameter twice to the page URL with the same value? Talal-- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
-
The following code,
PageDetails.Request.QueryString.ToString()
Returns the following. NewsID=66NewsID=66 Any ideas anyone?hum? I don't think it's strange. "NewsID=66NewsID=66" is something that you pass it to this page.. Steps to reproduce this ~ #1. Create web project #2. Write the following code in Page_Load.
string a = Request.QueryString.ToString(); Response.Write(a);
#3. Run the application. (Observe: You will see nothing since there is nothing in parameter.) #4. Type Like that "http://localhost:49614/WebSite4/Default.aspx?NewsID=66NewsID=66" in browser. (Note: Website4 should be the name of your website.) You will see the following in your page.NewsID=66NewsID%3d66
If you use this codeRequest.QueryString.ToString();
, you will get all parameters. If you wanna get individual one, use like that "Request.QueryString[0]
" Let me know if I miss something..Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
I take it the newsId only appears in there once ? Why are you calling ToString ?
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66 Will ToString() have any affect? ie a doubling effect?
-
hum? I don't think it's strange. "NewsID=66NewsID=66" is something that you pass it to this page.. Steps to reproduce this ~ #1. Create web project #2. Write the following code in Page_Load.
string a = Request.QueryString.ToString(); Response.Write(a);
#3. Run the application. (Observe: You will see nothing since there is nothing in parameter.) #4. Type Like that "http://localhost:49614/WebSite4/Default.aspx?NewsID=66NewsID=66" in browser. (Note: Website4 should be the name of your website.) You will see the following in your page.NewsID=66NewsID%3d66
If you use this codeRequest.QueryString.ToString();
, you will get all parameters. If you wanna get individual one, use like that "Request.QueryString[0]
" Let me know if I miss something..Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
The query string is as follows The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66 As copied from the URL
-
The query string is as follows The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66 As copied from the URL
Sam Heller wrote:
The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66
No.. I have tried with your querystring. (Environment: Windows Vista, Visual Studio 2005 C#) I got only
NewsID=66
. I suggest you to create new project and try again... If you still getting this issue, show us the sample code.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)