locked
After Message box how to refresh the asp.net form -vb.net RRS feed

  • Question

  • User-1578974752 posted

    After message box how can I refresh the form

    ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('Approved.');", True)

    or After opening a crystal report using response.write, how can I refresh the whole asp.net forum,so that the updated status (Approved)  will show in the form

    Response.WriteFile(String.Format("C:\inetpub\wwwroot\abc\efg\Reports\Slip\Report{0}.pdf", Convert.ToString(delsearch.Text)))

    if I use

    Response.Redirect(Request.RawUrl)   after the report opening code then ,page is refreshing and showing Approved status ,but the report is not opening.  Thanks

    Monday, November 25, 2019 6:55 AM

All replies

  • User-1780421697 posted

    Pooling is one of the option, you have some data-source where some event table or any table store some data, From your asp.net page after some time you read data from that table and do business logic,

    Like if you have some Admin Panel and you want to refresh see new users on the dashboard after some time and append them in existing list or notify admin then you can capture registration event in event grid/table and then using pooling after each n seconds you get the data and display to admin base on business logic.

    Other option is if you want to refresh entire page with some frequency like 10 seconds

    <head>
      <meta http-equiv="refresh" content="10">
    </head> 

    Monday, November 25, 2019 7:31 AM
  • User288213138 posted

    Hi shsu,

    After message box how can I refresh the form

    ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('Approved.');", True)

    or After opening a crystal report using response.write, how can I refresh the whole asp.net forum,so that the updated status (Approved)  will show in the form

    Response.WriteFile(String.Format("C:\inetpub\wwwroot\abc\efg\Reports\Slip\Report{0}.pdf", Convert.ToString(delsearch.Text)))

    You can use replace method to replace the current document by loading the same document at the specified URL. Furthermore, you can also set value to window.location.href= "CurrentPage.aspx" to load the same document after message box.

    The code:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    
    
    protected void Button1_Click(object sender, EventArgs e)
            {
                 string myscript = "alert('Approved.');window.location.replace(window.location.href);";        
                 Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", myscript, true);      
            }

    The result:

    Best regards,

    Sam

    Tuesday, November 26, 2019 3:20 AM
  • User-1578974752 posted

    After opening the report , is there any way to run

    Response.Redirect(Request.RawUrl)

    Thanks

    Wednesday, December 11, 2019 10:18 AM