This is a migrated thread and some comments may be shown as answers.

RadAlert not working while calling it on codebehind and returntoparent page.

1 Answer 89 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 06 Dec 2010, 07:32 AM
Hi freinds,
I am using radalert in codebehind for displaying message and after desplaying message am calling another javascript function to retun to the parent page.
following is my code.

private

 

bool UpdateCounter()

 

{

 

 

    string radalerts = "<script language='javascript'>function save(){radalert('Counter Saved Succesfully!', 330, 210); Sys.Application.remove_load(save);};     Sys.Application.add_load(save);</script>";

 

Page.ClientScript.RegisterStartupScript(

 

this.GetType(), "radalert", radalerts);
return true;

 

}

 

if

 

 

(UpdateCounter())

 

{

hdnChange.Value =

 

"Y";

 

ClearControl();

Page.RegisterStartupScript(

 

"myScript", "<script language=JavaScript>returnToParent();</script>");

 

}

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
<script type="text/javascript"> 
function returnToParent() { 
var oArg = new Object(); 
var oWnd = GetRadWindow(); 
oArg.IsChange = $get(
"<%=hdnChange.ClientID%>").value;

 

 

oWnd.close(oArg);

}

 

 

</script>

 

 

 

</telerik:RadCodeBlock>

but my radalert not displaying any message its just close the popup window and return to parent window without showing any radalert.

What is the wrong with above.
please help
Thanks in advance.
Manoj Gupta

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 07 Dec 2010, 03:11 PM
Hi Manoj,

radalert cannot block the execution thread. I would suggest to output the radalert dialog from the server and use JavaScript to close the RadWindow when the radalert dialog is closed.
e.g.
var oWnd = radalert("alert message");
oWnd.add_close(returnToParent);


Greetings,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Manoj
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or