Creating an Alert box in an Atlas UpdatePanel?
-
I've got a web project using Atlas. The web project also uses a master page. On one page, I need an alert box to pop up roughly half of the time the UpdatePanel is refreshed, and the text of the alert box needs to be dependent on the outcome of code executed before the UpdatePanel is re-rendered. Concretely: The page has a GridView that is filtered by radio button options, and there are some action buttons under the GridView. If the radio button selection is changed, I don't want an alert box to pop up. But if an action button under the grid is clicked, I want an alert box to pop indicating the outcome of the operation. I have tried writing dynamic JS directly into the UpdatePanel through the use of a Literal control, and I have tried using RegisterClientScriptBlock(). But in neither case has my alert box actually come up when I click one of my action buttons. Any ideas? Thanks.
-
I've got a web project using Atlas. The web project also uses a master page. On one page, I need an alert box to pop up roughly half of the time the UpdatePanel is refreshed, and the text of the alert box needs to be dependent on the outcome of code executed before the UpdatePanel is re-rendered. Concretely: The page has a GridView that is filtered by radio button options, and there are some action buttons under the GridView. If the radio button selection is changed, I don't want an alert box to pop up. But if an action button under the grid is clicked, I want an alert box to pop indicating the outcome of the operation. I have tried writing dynamic JS directly into the UpdatePanel through the use of a Literal control, and I have tried using RegisterClientScriptBlock(). But in neither case has my alert box actually come up when I click one of my action buttons. Any ideas? Thanks.
for as long as i knew, showing alert box in update panel can't be done. i don't know if there is any funky method to achieve this goal. when i was in the project that change application's framework 1.1 to 2.0 with asp.net AJAX, the solution to this problem is providing a label control that hidden or visible = false. if you want to show any message just show the label and assign it with some string value. you can add font-color = "red" if you want to, and font-size = "even blind man can see" i hope this help, if you have the funky method that i'm talking about above, please tell me what your method is ... :) thx fellow developer...
-
for as long as i knew, showing alert box in update panel can't be done. i don't know if there is any funky method to achieve this goal. when i was in the project that change application's framework 1.1 to 2.0 with asp.net AJAX, the solution to this problem is providing a label control that hidden or visible = false. if you want to show any message just show the label and assign it with some string value. you can add font-color = "red" if you want to, and font-size = "even blind man can see" i hope this help, if you have the funky method that i'm talking about above, please tell me what your method is ... :) thx fellow developer...
I am using hidden labels with bold red text right now. The problem is a bunch of the moron users have 800 x 600 screen res. I started getting flooded with complaints, "I never saw a confirmation message..." So my client asked me to take out all of the labels and replace them with alert boxes. When the alert box experiment failed, I tried using JS code to force the browser to scroll back to the top of the page. That failed too. That's when I began thinking there's a problem with rendering JS in a refreshed UpdatePanel. If it can't be done, then I'll just tell my client that that's the case, and that the next solution is to move the messages from the top of the screen to just above the buttons they click. Thanks for your help.
-
I am using hidden labels with bold red text right now. The problem is a bunch of the moron users have 800 x 600 screen res. I started getting flooded with complaints, "I never saw a confirmation message..." So my client asked me to take out all of the labels and replace them with alert boxes. When the alert box experiment failed, I tried using JS code to force the browser to scroll back to the top of the page. That failed too. That's when I began thinking there's a problem with rendering JS in a refreshed UpdatePanel. If it can't be done, then I'll just tell my client that that's the case, and that the next solution is to move the messages from the top of the screen to just above the buttons they click. Thanks for your help.
-
I've got a web project using Atlas. The web project also uses a master page. On one page, I need an alert box to pop up roughly half of the time the UpdatePanel is refreshed, and the text of the alert box needs to be dependent on the outcome of code executed before the UpdatePanel is re-rendered. Concretely: The page has a GridView that is filtered by radio button options, and there are some action buttons under the GridView. If the radio button selection is changed, I don't want an alert box to pop up. But if an action button under the grid is clicked, I want an alert box to pop indicating the outcome of the operation. I have tried writing dynamic JS directly into the UpdatePanel through the use of a Literal control, and I have tried using RegisterClientScriptBlock(). But in neither case has my alert box actually come up when I click one of my action buttons. Any ideas? Thanks.
Hi, Me too had similar problem. Try using following code private void ShowMessage(string message) { //This code works if there's no UpdatePanel //string script = "<script type=\"text/javascript\">alert('" + message + "');</script>"; //Page.ClientScript.RegisterStartupScript(this.GetType(), new Guid().ToString(), script); //Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); // We must do something slightly different with an UpdatePanel string jScript = "alert('" + message + "');"; ScriptManager.RegisterClientScriptBlock(UpdatePanelNewsLetter, UpdatePanelNewsLetter.GetType(), new Guid().ToString(), jScript, true); } now call the ShowMessage() function wherever required in UpdatePanel Regards...