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

Open Radwindow onload in master page

1 Answer 148 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 27 Mar 2014, 07:09 PM
I have a page that sits inside a master page so I do not have a body to do an onload statement, by research everyone says use the registerstartUpscript and it will work, however it is not.  How can I call a radwindow on page load from a page nested in a master site.  Thanks


function SelectInfo() {
            $find('<%=rwInfo.ClientID%>').show();
       }
 
 
<telerik:RadWindow ID="rwInfo" runat="server" Modal="true" NavigateUrl="Info.aspx" Width="1000px" Height="800px" OnClientClose="closeWindow"></telerik:RadWindow>
 
 
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
      If Not IsPostBack Then
          Dim userlogon As String = Split(Current.User.Identity.Name, "\")(1)
          HFUserId.Value = GetUserId(userlogon)
 
          If CheckIMOs(userlogon) = True Then
              Dim page As Label = CType(Master.FindControl("lblPage"), Label)
              page.Text = " - Move Add Change"
              ScriptManager.RegisterStartupScript(page, page.GetType(), "SomestartupScript", "SelectInfo();", True)
          Else
              Response.Redirect("~/ErrorPages/AdminError.aspx")
          End If
      End If
  End Sub

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 31 Mar 2014, 01:16 PM

Hello Kevin,

There are two key points in this code that can prevent a RadWindow from showing up:

  • the Sys.Application.Load event should be used if the RadWindow is disposed (i.e., a full postback or a partial postback that includes the RadWindow are initiated), as shown here: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-opening-from-server.html.
  • The Response.Redirect call (if executed), will change the entire pages response, so the script registration will not travel to the client, but only a redirect to the new page.

I hope this helps.




Regards, Marin Bratanov
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Window
Asked by
Kevin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or