Search code examples
returnurl

REgarding Return url in asp .net


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???


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