Re: Redirect to multiple pages without displaying each page...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Marc Cramer (cramer236_at_comcast.net)
Date: 12/17/04

  • Next message: Anthony Nystrom: "Set Statements in autogenerated dataset class do not have type def"
    Date: 17 Dec 2004 13:36:34 -0800
    
    

    Hello,

    Sorry I missed the first question about not displaying the page...
    try something like this

    C#
    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    if(Page.IsPostBack==false)
    {
    // check to see if we have our flag to indicate auto redirect...
    if(Request.QueryString["Flag"]!=null)
    {
    // call the processing methods here...
    DoStuff();
    // go to next page...
    Response.Redirect("NextPage.aspx", true);
    }
    // we got here so handle as a normal diplayed page...

    }
    }

    VB.NET
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    If Page.IsPostBack = False Then
    ' check to see if we have our flag to indicate auto redirect...
    If Not Request.QueryString("Flag") Is Nothing Then
    ' call the processing methods here...
    DoStuff()
    ' go to next page...
    Response.Redirect("NextPage.aspx", True)
    End If
    ' we got here so handle as a normal diplayed page...
    End If
    End Sub

    Marc


  • Next message: Anthony Nystrom: "Set Statements in autogenerated dataset class do not have type def"

    Relevant Pages

    • Re: Problem downloading image file
      ... Private Sub Page_Load(ByVal sender As System.Object, ... My only remaining issue is that when the Open or Save window> opens up, the default file name isnt the name of the image but is defaulting> to the name of the aspx page like this:> ... >> private void InitializeComponent() ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Need help converting C# code to VB.NET code...
      ... > private void PgTimer1_Elapsed ... > Private Sub PgTimer1_Elapsed(ByVal sender As System.Object, ... > Dim strResult As String ...
      (microsoft.public.dotnet.languages.vb)
    • Re: remoting client form, reference to object
      ... remoting is configured before anything else happens. ... > Private Sub Button1_Click(ByVal sender As System.Object, ... > private void ButtonCall_Click ...
      (microsoft.public.dotnet.framework.remoting)
    • Re: Problem downloading image file
      ... private void Page_Load ... private void SaveButton_Click(object sender, System.EventArgs e) ... > Private Sub Page_Load(ByVal sender As System.Object, ... > Dim byteRead As Integer ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Session Variable Length
      ... private void Page_Load(object sender, System.EventArgs e) ... // Put user code to initialize the page here ...
      (microsoft.public.dotnet.framework.aspnet)