URL question.

0 views
Skip to first unread message

hawkesed

unread,
Jan 8, 2007, 1:34:27 PM1/8/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I have an application written in ASP.net (not 2.0). Here is the issue I
am having:
I have a web application with a url. We want to add a couple of
parameters to the url so that a specific client and item is opened when
these parameters are present.
For example here is what we have now:
www.myapp.org and this opens up the login page.
We want to have something like:
www.myapp.org/client1%item1 (or some other delimiter other than '%')
>From within the application, how do I access the URL itself? If I have
it as a string then I want to parse it and use the information in it.
Does .NET have some classes/methods to do this?
Thanks for any help at all and have a good day.
Ed

hawkesed

unread,
Jan 8, 2007, 3:37:42 PM1/8/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
One other thing is that the application has a login.aspx page that the
users get redirected to. I want to be able to authenticate, bypass the
login.aspx page then pull up the specific item based on info sent in
from the url string.

Joe Enos

unread,
Jan 8, 2007, 5:42:08 PM1/8/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
The authentication is a major issue in itself - you should google
"asp.net forms authentication" to find quite a bit of reading material
for that.

Regarding the query string: the format of the URL is:

http://www.mysite.com/default.aspx?var1=value1&var2=value2

To access these values, you use the Request.QueryString object - for
example:
Request.QueryString["var1"] gives you the string "value1"

hawkesed

unread,
Jan 8, 2007, 6:36:47 PM1/8/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Much obliged Joe. These are excelent starting points. Have a good one!

carion1

unread,
Jan 8, 2007, 4:00:00 PM1/8/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
http://www.myapp.org/items.aspx?client=client_value&item=item_value

You can access those variables using Request.QueryString["client"] and
Request.QueryString["item"].

Reply all
Reply to author
Forward
0 new messages