activate new page from C# - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

activate new page from C#

danwing321danwing321 Posts: 6Member
I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.

I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.

Thanks.

Comments

  • iwilld0itiwilld0it Posts: 1,134Member
    : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    :
    : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    :
    : Thanks.
    :

    Use either ...

    [code]
    Server.Transfer("somePage.aspx");
    [/code]

    - or -

    [code]
    Response.Redirect("somePage.aspx");
    [/code]

    To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.

    [code]
    ' Does Not Work
    Server.Transfer("http://www.yahoo.com");
    [/code]


  • danwing321danwing321 Posts: 6Member
    : : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    : :
    : : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    : :
    : : Thanks.
    : :
    :
    : Use either ...
    :
    : [code]
    : Server.Transfer("somePage.aspx");
    : [/code]
    :
    : - or -
    :
    : [code]
    : Response.Redirect("somePage.aspx");
    : [/code]
    :
    : To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.
    :
    : [code]
    : ' Does Not Work
    : Server.Transfer("http://www.yahoo.com");
    : [/code]
    :
    :
    :

    I think that I have a poor design and/or don't understand the sequence of events.

    I have a hyperlink which activates a page which only says "search in progress, please wait" and then does the response.redirect to a page which displays the data. The response.redirect is in the Page_Load of the "in progress" page. I never see this.

    When I select the hyperlink, the search function (which is in the Page_Load of the "results") appears to be started but the display remains on the "search" page until the search is complete and then the "results" page is displayed. I never see the "in progress" page.

    [code]
    Search.aspx
    contains hyperlink to "SearchInProgress.aspx" (with QUERY_STRING)


    SearchInProgress.aspx.cs
    Page_Load
    queryString = Request.ServerVariables["QUERY_STRING"];
    Response.Redirect("SearchResults.aspx" + queryString);

    SearchResults.aspx.cs
    Page_Load
    query db using "QUERY_STRING"
    Display search results
    [/code]
  • iwilld0itiwilld0it Posts: 1,134Member
    : : : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    : : :
    : : : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    : : :
    : : : Thanks.
    : : :
    : :
    : : Use either ...
    : :
    : : [code]
    : : Server.Transfer("somePage.aspx");
    : : [/code]
    : :
    : : - or -
    : :
    : : [code]
    : : Response.Redirect("somePage.aspx");
    : : [/code]
    : :
    : : To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.
    : :
    : : [code]
    : : ' Does Not Work
    : : Server.Transfer("http://www.yahoo.com");
    : : [/code]
    : :
    : :
    : :
    :
    : I think that I have a poor design and/or don't understand the sequence of events.
    :
    : I have a hyperlink which activates a page which only says "search in progress, please wait" and then does the response.redirect to a page which displays the data. The response.redirect is in the Page_Load of the "in progress" page. I never see this.
    :
    : When I select the hyperlink, the search function (which is in the Page_Load of the "results") appears to be started but the display remains on the "search" page until the search is complete and then the "results" page is displayed. I never see the "in progress" page.
    :
    : [code]
    : Search.aspx
    : contains hyperlink to "SearchInProgress.aspx" (with QUERY_STRING)
    :
    :
    : SearchInProgress.aspx.cs
    : Page_Load
    : queryString = Request.ServerVariables["QUERY_STRING"];
    : Response.Redirect("SearchResults.aspx" + queryString);
    :
    : SearchResults.aspx.cs
    : Page_Load
    : query db using "QUERY_STRING"
    : Display search results
    : [/code]
    :

    The reason you dont see the words "Search In Progress, is because that page immediately redirects. To be honest, the search results should come back so quick, that it would be pointless to show the user these words.



  • danwing321danwing321 Posts: 6Member
    : : : : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    : : : :
    : : : : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    : : : :
    : : : : Thanks.
    : : : :
    : : :
    : : : Use either ...
    : : :
    : : : [code]
    : : : Server.Transfer("somePage.aspx");
    : : : [/code]
    : : :
    : : : - or -
    : : :
    : : : [code]
    : : : Response.Redirect("somePage.aspx");
    : : : [/code]
    : : :
    : : : To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.
    : : :
    : : : [code]
    : : : ' Does Not Work
    : : : Server.Transfer("http://www.yahoo.com");
    : : : [/code]
    : : :
    : : :
    : : :
    : :
    : : I think that I have a poor design and/or don't understand the sequence of events.
    : :
    : : I have a hyperlink which activates a page which only says "search in progress, please wait" and then does the response.redirect to a page which displays the data. The response.redirect is in the Page_Load of the "in progress" page. I never see this.
    : :
    : : When I select the hyperlink, the search function (which is in the Page_Load of the "results") appears to be started but the display remains on the "search" page until the search is complete and then the "results" page is displayed. I never see the "in progress" page.
    : :
    : : [code]
    : : Search.aspx
    : : contains hyperlink to "SearchInProgress.aspx" (with QUERY_STRING)
    : :
    : :
    : : SearchInProgress.aspx.cs
    : : Page_Load
    : : queryString = Request.ServerVariables["QUERY_STRING"];
    : : Response.Redirect("SearchResults.aspx" + queryString);
    : :
    : : SearchResults.aspx.cs
    : : Page_Load
    : : query db using "QUERY_STRING"
    : : Display search results
    : : [/code]
    : :
    :
    : The reason you dont see the words "Search In Progress, is because that page immediately redirects. To be honest, the search results should come back so quick, that it would be pointless to show the user these words.
    :
    :
    :
    :
    There are times when the query to SQL Server will take 20-30 seconds and during this time, the initial "search" page is displayed (not the "in progress" page).
    It appears that the server handles the redirect without the client page being refreshed. The "results" page Page_Load event is processing but the server has not changed the display to the Page_Load of the "in Progress" page.

    Thanks again.
  • danwing321danwing321 Posts: 6Member
    : : : : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    : : : :
    : : : : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    : : : :
    : : : : Thanks.
    : : : :
    : : :
    : : : Use either ...
    : : :
    : : : [code]
    : : : Server.Transfer("somePage.aspx");
    : : : [/code]
    : : :
    : : : - or -
    : : :
    : : : [code]
    : : : Response.Redirect("somePage.aspx");
    : : : [/code]
    : : :
    : : : To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.
    : : :
    : : : [code]
    : : : ' Does Not Work
    : : : Server.Transfer("http://www.yahoo.com");
    : : : [/code]
    : : :
    : : :
    : : :
    : :
    : : I think that I have a poor design and/or don't understand the sequence of events.
    : :
    : : I have a hyperlink which activates a page which only says "search in progress, please wait" and then does the response.redirect to a page which displays the data. The response.redirect is in the Page_Load of the "in progress" page. I never see this.
    : :
    : : When I select the hyperlink, the search function (which is in the Page_Load of the "results") appears to be started but the display remains on the "search" page until the search is complete and then the "results" page is displayed. I never see the "in progress" page.
    : :
    : : [code]
    : : Search.aspx
    : : contains hyperlink to "SearchInProgress.aspx" (with QUERY_STRING)
    : :
    : :
    : : SearchInProgress.aspx.cs
    : : Page_Load
    : : queryString = Request.ServerVariables["QUERY_STRING"];
    : : Response.Redirect("SearchResults.aspx" + queryString);
    : :
    : : SearchResults.aspx.cs
    : : Page_Load
    : : query db using "QUERY_STRING"
    : : Display search results
    : : [/code]
    : :
    :
    : The reason you dont see the words "Search In Progress, is because that page immediately redirects. To be honest, the search results should come back so quick, that it would be pointless to show the user these words.
    :
    :
    :
    :
    There are times whe
  • danwing321danwing321 Posts: 6Member
    : : : : I'm very new to ASP .NET programming and would like to know how to callup a page via C# code.
    : : : :
    : : : : I would like to display a "waiting" page until a database read is complete and then automatically take the user to a page displaying the results.
    : : : :
    : : : : Thanks.
    : : : :
    : : :
    : : : Use either ...
    : : :
    : : : [code]
    : : : Server.Transfer("somePage.aspx");
    : : : [/code]
    : : :
    : : : - or -
    : : :
    : : : [code]
    : : : Response.Redirect("somePage.aspx");
    : : : [/code]
    : : :
    : : : To transfer user to another page. The first one is more efficient, but does not work for links that point to other websites.
    : : :
    : : : [code]
    : : : ' Does Not Work
    : : : Server.Transfer("http://www.yahoo.com");
    : : : [/code]
    : : :
    : : :
    : : :
    : :
    : : I think that I have a poor design and/or don't understand the sequence of events.
    : :
    : : I have a hyperlink which activates a page which only says "search in progress, please wait" and then does the response.redirect to a page which displays the data. The response.redirect is in the Page_Load of the "in progress" page. I never see this.
    : :
    : : When I select the hyperlink, the search function (which is in the Page_Load of the "results") appears to be started but the display remains on the "search" page until the search is complete and then the "results" page is displayed. I never see the "in progress" page.
    : :
    : : [code]
    : : Search.aspx
    : : contains hyperlink to "SearchInProgress.aspx" (with QUERY_STRING)
    : :
    : :
    : : SearchInProgress.aspx.cs
    : : Page_Load
    : : queryString = Request.ServerVariables["QUERY_STRING"];
    : : Response.Redirect("SearchResults.aspx" + queryString);
    : :
    : : SearchResults.aspx.cs
    : : Page_Load
    : : query db using "QUERY_STRING"
    : : Display search results
    : : [/code]
    : :
    :
    : The reason you dont see the words "Search In Progress, is because that page immediately redirects. To be honest, the search results should come back so quick, that it would be pointless to show the user these words.
    :
    :
    :
    :
    There are times when the query to SQL Server will take 20-30 seconds and during this time, the initial "search" page is displayed (not the "in progress" page).
    It appears that the server handles the redirect without the client page being refreshed. The "results" page Page_Load event is processing but the server has not changed the display to the Page_Load of the "in Progress" page.

    Thanks again.

Sign In or Register to comment.