Hi,
I would like to know how to retrieve a passed value in J#. I have a new page and I want to access it's passed value.
New Retrieved Page Example URL:
http://test/default.aspx pageStatus=0
I have an int variable (int pageStatus;) in my default.aspx page and I want to assign this variable the value found in http://test/default.aspx pageStatus=0
What method do I use
Thanks in advance,
Allan

Passed value in ASP Pages
Dan Burnip
The solution to your problem is quite simple once you know where to look. All variables passed in on the URL (also called the query string) can be retrieved from the QueryString property on the Request object. This is very similar to how it's done in Java.
The exact line of code you need to do your task is
pageStatus=Integer.Parse(Request.QueryString.Get("pageStatus"));
Cheryl Marland
Use the ampersand '&' to separate values in your url so in your case you'd have something like
http://www.yourdomain.com/yourpage.aspx pageStatus=somevalue&userID=anotherValue
Be careful when using variables passed in on the URL. If the right checks aren't put in place, someone can use them to compromise your application's security.
Well let me clarify that. It will be easier for someone to use them to compromise your app's security.
Tim Jarvis
Again that's why I come here to help my fellow developer get past the hurdles that I've overcome (through trial and error mostly).
Also, if you need help getting your application off the ground, I may know a consultant who can provide assistance in that regard as well
Zeke19801980
ampersandz
Drakkaris
koulbassa
Also if you're migrating from Java, I'd recommend C# over J#. J# was intended to help people to migrate programs written in Visual J++ to .Net.
C# is very close in syntax to Java. It even has a similar API to that of java. For instance, to write to the console in Java you say
system.Out.println("Hello World");
In C#, the code is
System.Console.WriteLine("Hello World");
Packerfan
Anytime. Actually passing data in the header is insecure too, it's just more difficult for someone to casually pass in parameters and values.
For instance, if someone happens to find out the userid of say an administrator on your web app, they can simply pass in that user id and have the access of an administrator without the proper precautions.
One thing I'd suggest is linking a user to a session on successful login and using the session to store any security related information.
If you'd like to discuss more with me send an email.
Michael