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

Alert window isn't redirecting

1 Answer 55 Views
Window
This is a migrated thread and some comments may be shown as answers.
Annette
Top achievements
Rank 1
Annette asked on 19 Apr 2011, 08:50 PM
I have my alert button showing, however after the OK is clicked it isn't redirecting the page.

ASPX:

 

<AlertTemplate>

 

 

<div class="windowpopup radalert">

 

 

<div class="dialogtext" style="text-align: center;">

 

{1}

 

</div>

 

 

<div>

 

 

<a onclick="$find('{0}').close(); window.location.href='home.aspx';" class="radwindowbutton"

 

 

href="javascript:void(0);">

 

 

<span class="outerspan">

 

 

<span class="innerspan" style="text-align: center;">##LOC[OK]##</span>

 

 

</span>

 

 

</a>

 

 

</div>

 

 

</div>

 

 

</AlertTemplate>

 

 

<Windows>

 

 

<telerik:RadWindow ID="wdwEmail" runat="server" EnableEmbeddedSkins="False" Skin="DMID"

 

 

Title="" Height="320px" Left="150px" Modal="true" ReloadOnShow="true" Width="300px"

 

 

ShowContentDuringLoad="false">

 

 

</telerik:RadWindow>

 

 

</Windows>

 

 

</telerik:RadWindowManager>


Code Behind:

 

 

 

protected void btnSubmit_Click(object sender, EventArgs e)

 

 

{

 

nBus.SendOrderSubmitNotification(uProfile, oProfile, pProfiles, bList);

 

 

ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "<script type='text/javascript'>Sys.Application.add_load(function(){radalert('Your Order has been saved');})</script>", false);

 

{

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Apr 2011, 12:33 PM
Hi Annette,

When I run the code locally, everything is working as expected and the page is redirected. This leads me to believe that you may have another RadWindowManager on that page. In such case, you need to take into consideration the following:

   1. All RadWindowManager's functions (radopen, radalert, radconfirm, radprompt, GetRadWindowManager, etc) are always using the first rendered RadWindowManager on the page.
   2. Every RadWindowManager "knows" only the RadWindows that are declared in its Windows collection.

This means that if you have a RadWindow2 as a standalone control OR declared in RadWindowManager2, and you use something like radopen(myUrl, "RadWindow2");, radopen will use RadWindowManager1 and will open a new RadWindow with the settings taken from RadWindowManager1. To avoid that problem, when you have multiple managers on a page, you need to get a reference to the correct RadWindowManager first and then call its methods.
e.g.
var manager = $find("<%= RadWindowManager2.ClientID %>");
manager.open(myUrl, "RadWindow2");


same holds true for the radalert dialog. You need to get a reference to it first and then call manager's radalert() method:

var manager = $find("<%= RadWindowManager2.ClientID %>");
manager.radalert("radalert called");


Kind regards,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start 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
Window
Asked by
Annette
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or