title: Confirmation message from the ASP.NET code behind file
body: <p>I have a login screen Login.aspx after login I want to show a confirmation message saying </p>
  
  <p>"You are being redirected to the Demo page. Do you want to continue?",</p>
  
  <p>if the user clicked yes, I need to redirect them to a demo page. Other wise redirect to another home page. How can I do this?</p>
  
  <p>I want something like the following...</p>
  
  <pre><code>protected void Login_Click(object sender, ImageClickEventArgs e)
         {
            //some validation and calculations..
  
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "confirm('You are redirecting to Demo page ". Do you want to continue" ?');", true);
  
  
            //My doubt is this
            If(ok button clicked)
            {
               //redirect to demo page
            }
            else
            {
               //redirect to home page
            }
  
         }
  </code></pre>