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

can i add a radwindow to a masterpage

1 Answer 149 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anwar
Top achievements
Rank 1
Anwar asked on 16 Sep 2012, 08:58 AM
i want to add the rad window to the master page and inherit it, but it gives me an error "Microsoft JScript runtime error: Unable to get value of the property 'show': object is null or undefined"
I have added this as follows

<%

-- "About" window --%>

 

<telerik:RadWindow runat="server" ID="AboutWindow" Overlay="false" VisibleStatusbar="false" Behaviors="Move,Close" Animation="None" Modal="true" Title="About This Demo" Width="490px" Height="425px" IconUrl="Images/about_icon.png" OnClientShow="aboutWindowShow">

 

<ContentTemplate>

 

<uc:About runat ="server" ID="AboutDialog" />

 

</ContentTemplate>

 

</telerik:RadWindow>


and i have added this function

 

function buttonClicked(sender, args) {

if (args.get_item().get_index() == 0)

$find(

 

'AboutWindow').show();

  

 

}


can you tell me what i am doing wrong

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Sep 2012, 11:56 AM
Hi Anwar,

The master page creates INaming containers, which means that the controls' client-side IDs are not the same as the ones you use on the server. You would need to use server code blocks to get the correct id:
$find('<%=AboutWindow.ClientID%>').show();
Note that this has to be in the master page as well if you need to call this function from a content page I would suggest adding a function to return a reference to this RadWIndow in the master page and call if from the content pages:
function getRW(){
   return $find("<%=AboutWindow.ClientID%>");
}
and
getRW().show();



Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Anwar
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or