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

  • Thread starter Thread starter cc dd via .NET 247
  • Start date Start date
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
 
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
 
Back
Top