I am trying to open a RadWindow when clicking on a RadButton (RadButton1) but it does nothing. However when i try to do the same with an asp Button (Button3) the RadWindow opens successfully. What am i missing? Thank you in advance.
Here is a piece of the code:
Here is a piece of the code:
<
div
id
=
"ContentTemplateZone"
class
=
"qsf-ib infoBox"
>
<
asp:Button
ID
=
"Button3"
Text
=
"Open rad window from Button"
runat
=
"server"
OnClientClick
=
"openWinContentTemplate(); return false;"
>
</
asp:Button
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Open rad window from RadButton"
ButtonType
=
"StandardButton"
OnClientClick
=
"openWinContentTemplate(); return false;"
>
<
Icon
PrimaryIconCssClass
=
"rbAdd"
PrimaryIconLeft
=
"4"
PrimaryIconTop
=
"4"
></
Icon
>
</
telerik:RadButton
>
<
br
/>
<
asp:Label
ID
=
"Label1"
Text
=
""
runat
=
"server"
></
asp:Label
>
<
script
type
=
"text/javascript"
>
function populateValue() {
$get("<%=Label1.ClientID %>").innerHTML = $get("<%= Textbox1.ClientID %>").value;
alert($get("<%= Textbox1.ClientID %>").value);
//the RadWindow's content template is an INaming container and the server code block is needed
$find("<%=RadWindow_ContentTemplate.ClientID%>").close();
}
function openWinContentTemplate() {
alert("open");
$find("<%=RadWindow_ContentTemplate.ClientID %>").show();
}
</
script
>
</
div
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"RadWindow_ContentTemplate"
RestrictionZoneID
=
"ContentTemplateZone"
Modal
=
"true"
>
<
ContentTemplate
>
<
p
class
=
"contText"
>
Enter a value here and click the button to close the RadWindow and pass the
value to the main page.
</
p
>
<
div
class
=
"contButton"
>
<
asp:TextBox
ID
=
"Textbox1"
runat
=
"server"
></
asp:TextBox
>
</
div
>
<
p
class
=
"contText"
>
Via a simple JavaScript function:
</
p
>
<
div
class
=
"contButton"
>
<
asp:Button
ID
=
"Button1"
Text
=
"send value and close"
runat
=
"server"
OnClientClick
=
"populateValue(); return false;"
>
</
asp:Button
>
</
div
>
<
p
class
=
"contText"
>
Via a simple method in the code-behind:
</
p
>
<
div
class
=
"contButton"
>
<
asp:Button
ID
=
"Button2"
Text
=
"send value through code-behind"
runat
=
"server"
OnClick
=
"Button2_Click"
>
</
asp:Button
>
</
div
>
</
ContentTemplate
>
</
telerik:RadWindow
>