Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. messagebox does not appear when asp:updatepanel and updateprogress control is used

messagebox does not appear when asp:updatepanel and updateprogress control is used

Scheduled Pinned Locked Moved ASP.NET
designsysadmindata-structuressecurityworkspace
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sanjubaba
    wrote on last edited by
    #1

    hi, i am displaying a messagebox server side. For that i have developed a class which is called from an aspx page which inherits masterpage. the master page includes asp:updatepanel control and updateprogress control. due to this i cant use httpconetxt.current.response.write to display the message box. Following is the aspx code: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Presentation_Admin_Menu_MenuGroup_MenuGroupDetail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MsgPopUp.Show(Page, "sandeep with me"); } } THIS IS THE CLASS CODE FOR DISPLAYING THE MESSAGEBOX ==================================================== public static void Show_Panel(Page sender, string Message) { try { UpdatePanel sender1 = (UpdatePanel)sender.Master.FindControl("UpdPanel"); ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('"+Message+"');", true); //if (!(handlerPages.Contains(HttpContext.Current.Handler))) //{ // Page currentPage = (Page)HttpContext.Current.Handler; // if (!((currentPage == null))) // { // Queue messageQueue = new Queue(); // messageQueue.Enqueue(Message); // handlerPages.Add(HttpContext.Current.Handler, messageQueue); // currentPage.Unload += new EventHandler(CurrentPageUnload_withupdpanel); // } //} //else //{ // Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); // queue.Enqueue(Message); //} } catch (Exception ex) { throw ex; } } private static void CurrentPageUnload_withupdpanel(object sender, EventArgs e) { try { Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); if (queue != null) { StringBuilder builder = new StringBuilder

    J 2 Replies Last reply
    0
    • S sanjubaba

      hi, i am displaying a messagebox server side. For that i have developed a class which is called from an aspx page which inherits masterpage. the master page includes asp:updatepanel control and updateprogress control. due to this i cant use httpconetxt.current.response.write to display the message box. Following is the aspx code: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Presentation_Admin_Menu_MenuGroup_MenuGroupDetail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MsgPopUp.Show(Page, "sandeep with me"); } } THIS IS THE CLASS CODE FOR DISPLAYING THE MESSAGEBOX ==================================================== public static void Show_Panel(Page sender, string Message) { try { UpdatePanel sender1 = (UpdatePanel)sender.Master.FindControl("UpdPanel"); ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('"+Message+"');", true); //if (!(handlerPages.Contains(HttpContext.Current.Handler))) //{ // Page currentPage = (Page)HttpContext.Current.Handler; // if (!((currentPage == null))) // { // Queue messageQueue = new Queue(); // messageQueue.Enqueue(Message); // handlerPages.Add(HttpContext.Current.Handler, messageQueue); // currentPage.Unload += new EventHandler(CurrentPageUnload_withupdpanel); // } //} //else //{ // Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); // queue.Enqueue(Message); //} } catch (Exception ex) { throw ex; } } private static void CurrentPageUnload_withupdpanel(object sender, EventArgs e) { try { Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); if (queue != null) { StringBuilder builder = new StringBuilder

      J Offline
      J Offline
      Jamil Hallal
      wrote on last edited by
      #2

      Hi, Try this, i got the same issue ScriptManager.RegisterClientScriptBlock(sender1, typeof(UpdatePanel), ("dialogJavascript" + this.ID), "alert(\"Registered\");", True)

      Regards, Jamil

      S 1 Reply Last reply
      0
      • S sanjubaba

        hi, i am displaying a messagebox server side. For that i have developed a class which is called from an aspx page which inherits masterpage. the master page includes asp:updatepanel control and updateprogress control. due to this i cant use httpconetxt.current.response.write to display the message box. Following is the aspx code: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Presentation_Admin_Menu_MenuGroup_MenuGroupDetail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MsgPopUp.Show(Page, "sandeep with me"); } } THIS IS THE CLASS CODE FOR DISPLAYING THE MESSAGEBOX ==================================================== public static void Show_Panel(Page sender, string Message) { try { UpdatePanel sender1 = (UpdatePanel)sender.Master.FindControl("UpdPanel"); ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('"+Message+"');", true); //if (!(handlerPages.Contains(HttpContext.Current.Handler))) //{ // Page currentPage = (Page)HttpContext.Current.Handler; // if (!((currentPage == null))) // { // Queue messageQueue = new Queue(); // messageQueue.Enqueue(Message); // handlerPages.Add(HttpContext.Current.Handler, messageQueue); // currentPage.Unload += new EventHandler(CurrentPageUnload_withupdpanel); // } //} //else //{ // Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); // queue.Enqueue(Message); //} } catch (Exception ex) { throw ex; } } private static void CurrentPageUnload_withupdpanel(object sender, EventArgs e) { try { Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler])); if (queue != null) { StringBuilder builder = new StringBuilder

        J Offline
        J Offline
        Jamil Hallal
        wrote on last edited by
        #3

        You can always check the key for the script with IsClientSideScriptRegistered to ensure you don't register it multiple times.

        Regards, Jamil

        1 Reply Last reply
        0
        • J Jamil Hallal

          Hi, Try this, i got the same issue ScriptManager.RegisterClientScriptBlock(sender1, typeof(UpdatePanel), ("dialogJavascript" + this.ID), "alert(\"Registered\");", True)

          Regards, Jamil

          S Offline
          S Offline
          sanjubaba
          wrote on last edited by
          #4

          hi jamii, this.ID in you reply means exactly which id. i am actually displaying the messagebox through class. in my aspx page i am using the object of the class and passing the message to the method which in turn displays the messagebox Sandeep Kumbhar

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups