Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Testing a QueryString

  Asked By: Leona    Date: Jul 27    Category: Asp.net    Views: 950
  

Here is my problem. I'm converting an ASP page to ASPX. The
original page uses the QUERYSTRING function to grab information out
of the header. I would like to test this method with my new page.
How do I append the information in the header of my new page? Is
there a way I can do this before the page is loaded or must it be
after.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Willie Gomez     Answered On: Jul 27

asp.NET is adifferent animal to asp3

its events driven OO, etc.

it uses events that are fired in an order as the page  loads ( remember flush .. this is flush with bells on)

look in help for actual order or the way controls/pages events are fired . No - the best way is to set up a skeleton project and do a load of response.writes to write out the order for you. Add some ascx controls to your page and write out responses for all the events you plug in ... and the one you'll use most will probably be pre_render.
Briefly ... page load, control_load, page_prerender, control_prerender, plus events inbetween. You just goot aget to knwo how it all works and EXPERIMENT.

though querystring works just about the same ... so what's the problem  exactly ?

 
Answer #2    Answered By: Pravat Jainukul     Answered On: Jul 27

My problem  is I want to test  the QueryString by using the original
appended string that shows up on the asp  Page. For example,

Current ASP header  shows:

http://originalasppage/?PRODUCT=Product?Version=Version

I want my test aspx page  to show this on page load:

http://aspxpage/?PRODUCT=Product?Version=Version

This way I can test the QueryString method  with my test aspx  page.

Does this help?

 
Answer #3    Answered By: Rocco Anderson     Answered On: Jul 27

Perhaps what you are trying to do is to take the original url ... which is dircted to an asp3 (.asp) page  and rip out the querystring part of it and, from the original asp3 page redirect to an aspx  page using that querystring.

So really, the code you need would be in asp3 VBScript and you merely append  to a new url and redirect to the aspx page.


Well, just using querystring will grab  the whole of the actual querystring, which you can then append to a new url.
In your example Request.ServerVariables("QUERY_STRING") should give you the string "PRODUCT=Product?Version=Version"


<%@ Language=VBScript %>
<%
response.expires = 0
Response.Redirect("http://yourdomain/testing.aspx?" & Request.ServerVariables("QUERY_STRING"))
%>

There are loads of things you can do to manipulate whats in the url address bar etc - see attatched file for some ideas.

 
Answer #4    Answered By: Scott Simmons     Answered On: Jul 27

To any that open the previous attachment called servertest.asp.txt....

there is a remnant of an old virus in there, it's nothing - honest.
Just delete the last line that opens a browser window .... it won't do anything its just that it opens it up off screen so you can't close it.

 
Didn't find what you were looking for? Find more on Testing a QueryString Or get search suggestion and latest updates.




Tagged: