Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

QuertyString

I have a page (aspx)  that has this snippett of coding below. Another pages calls it and the url is correctly formed as I can see it when it calls the page. It shows the parameter "vf" just as it should. However when I try to retreive it with Request.Quertystring and display on the page, it is blank. I only have the blip about being at page load showing...What am I doing wrong here?


<script language="vb" runat="server">

    Sub Page_Load(sender As Object, e As EventArgs)
        Response.Write("At page load")
        Dim vfile As String = Request.QueryString("vf")
        Response.Write("value of vfile: " & vfile)
    End Sub

 </script>
0
Overthere
Asked:
Overthere
  • 4
  • 3
  • 3
  • +2
3 Solutions
 
nap0leonCommented:
Typo
You have "QuertyString"
instead of "QueryString"
0
 
Rajkumar GsSoftware EngineerCommented:
Can you post entire URL with querystring here ?

Raj
0
 
nap0leonCommented:
nevermind.. typo only in the article title not the actual function.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Paul MacDonaldDirector, Information SystemsCommented:
What's in the URL when you reach this page?  What value should "vt" be?
0
 
Rajkumar GsSoftware EngineerCommented:
Make sure you have '&' or '?' before the querystring 'vf'

For eg:-
http://www.yoursite.com?id=1233&vf=32323  --> Valid
http://www.yoursite.com?id=1233vf=32323  --> Invalid

any error like this ?

Raj
0
 
OverthereAuthor Commented:
here is the value of the url as it is passed:
 var nuurl = "view2.aspx?fv=" + url;

and when I display nuurl with an alert is is correct: view2.aspx?fv=/myweb/Images/pica.jpg

and it does pop up view2.aspx,its http address looks fine,  and I use a response.write to show the value of the parameter after issuing a Request.QueryString("vf") and it is blank....
0
 
Rajkumar GsSoftware EngineerCommented:
In querystring, it is 'fv' and you are trying to call 'vf' - spelling mistake :)

raj
0
 
Paul MacDonaldDirector, Information SystemsCommented:
What [RajkumarGS] said.
0
 
OverthereAuthor Commented:
it was a typo error when I responded with a comment - I double-checked. I tried putting it in a Session var and that doesn't even work - always has the same value...
0
 
Paul MacDonaldDirector, Information SystemsCommented:
I think maybe the slashes in the query string are causing a problem.  In VB.Net, I'd say URLEncode the path.  I don't know what the javascript equivilent is.
0
 
OverthereAuthor Commented:
I will try it and let you know...may be afew dsays...
0
 
ynainaCommented:
Try Request.Params[""]
0
 
OverthereAuthor Commented:
Thanks folks...a mixed bag causing problem! ;)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now