473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Grabbing paramter in the URL

Hello,
I'm not sure if this is the place to post this, but...
In c#, I'm trying to find out how to grab a parameter from the incomming URL
using c#. I'm passing it in from another asp page in the URL.
Can someone tell me the mechanism to do this?

Thanks
Nov 19 '05 #1
3 1166
Hi,

You'll be wanting to use the Request object. For example if you're URL
is:

mypage.aspx?Username=John

You can grab that info in C# on the target page by using something
like:

string myUser = Request.QueryString["Username"]

Regards,

Peter Chadwick (MCP)
pe**@code-explorers.com

Nov 19 '05 #2
That's just what I needed. Thanks a bunch! :)

"Peter Chadwick (MCP)" <pe**@code-explorers.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

You'll be wanting to use the Request object. For example if you're URL
is:

mypage.aspx?Username=John

You can grab that info in C# on the target page by using something
like:

string myUser = Request.QueryString["Username"]

Regards,

Peter Chadwick (MCP)
pe**@code-explorers.com

Nov 19 '05 #3
Example:

int id = System.Convert.ToInt32 (Request.Params["id"]);

Eliyahu

"Randy" <te**@temp.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hello,
I'm not sure if this is the place to post this, but...
In c#, I'm trying to find out how to grab a parameter from the incomming URL using c#. I'm passing it in from another asp page in the URL.
Can someone tell me the mechanism to do this?

Thanks

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Joe | last post by:
I need to connect to 10 web sites to grab content from them. I would like to connect to each site simultaneously so that I can obtain the data as fast as possible. I am familar doing this with...
4
by: InvisibleMan | last post by:
Hi, Thanks for any help in advance... I'm wondering if anyone knows how or has the resource for graabing a users email address without them knowing? Before I hear all the 'Its not ethical'...
1
by: Eirik Eldorsen | last post by:
I've made a query which works fine. My problem is that Access ask for a paramter value when I run the query, and I can't understand why. The query: SELECT Ordre.ID, Ordre.OpprettetDato,...
5
by: tshad | last post by:
I can't seem to find where to reset the parameter list. Dim objCmd as New SqlCommand(CommandText,objConn) with objCmd.Parameters .Add("@StateCode",SqlDbType.Char,2).value = ByState.SelectedValue...
0
by: .Net Sports | last post by:
I've been looking everywhere, but i can't locate any functions, or articles on the net or my resources, on how to open a file using vb.net, and then grabbing certain parts of the file, and putting...
1
by: Islamegy® | last post by:
When i call stored procedure which have an output paramter, t'm unable to get the value How could i fix it?? here is the method.... ---------------------------- userid = 0; SqlParameter...
5
by: Miro | last post by:
This qustion is probably for people who have created large apps with subs / or functions that have a lot of parameters and used in a lot of places in ur whole app. ( lets say its ur own library...
5
by: joe_doufu | last post by:
Hi, old web developer, new to Ajax and XML here. I'm developing an application that grabs an XML file from a (PHP) web service. In fact, it's going to be an online game. When the user clicks a...
2
by: Garx | last post by:
Hi Guys, This is my first post so bear with me :) I am running Access 2003 and am still feeling my way around it. I have a form (FORM_IDL) that uses a combobox (cboIDA) which uses a query as...
3
by: araman | last post by:
i have a simple paramter query. one of the fields is called vendors. the criteria is "Like is there a way to construct the query in which "like " but if it is left blank then all record are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.