Question

pseudocode :

  1. declare a variable
  2. store Return url in that variable.
  3. if variable is not equal to null redirect to returnurl
    else redirect to homepage.

can someone give me C# asp .net code for the above mentioned pseudocode as I'm completely new to progamming world???

Was it helpful?

Solution

   string url="http://www.google.co.in/?gws_rd=cr" // variable declaration and assigning url to variable 

    if(url !="")           // checking the string variable is empty or not 
  {
Response.Redirect(url);    // variable is not empty redirect to given URL

} 

else

{
Response.Redirect(HOMEPAGE URL);   // else redirect to given home page

}

try this and let me now. it will helpful

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top