i want to check whether a value is passing via an url

C

cc dd via .NET 247

Hi!!
i am working in .net and i got link to a web page from twoplaces. From first place i just want to open the page and theuser can fill in the information and save it. From the secondplace i am passing a value thru the url and when the page openit should display the details about that particular value. nowmy problem is that i want to check whether the url contains somevalue or not. Could u please help!!!!!!!!!!!! its sourgent..........

Thanks for helping me in advance
 
G

GrantMagic

Check if the value exists before trying to use it.

E.G.
url being passed:
either www.site.com/page.aspx or www.site.com/page.aspx?query=1

In your code:
void Page_Load(object Sender, EventArgs e)
{
if(!Page.IsPostBack)
{
if(Request.QueryString["query"] != "" &&
Request.QueryString["query"] != null)
{
//Query value exists
}
else
{
//Query value doesn't exist
}
}
}

Hi!!
i am working in .net and i got link to a web page from two places. From
first place i just want to open the page and the user can fill in the
information and save it. From the second place i am passing a value thru the
url and when the page open it should display the details about that
particular value. now my problem is that i want to check whether the url
contains some value or not. Could u please help!!!!!!!!!!!! its so
urgent..........

Thanks for helping me in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top