I am trying to pop a RadWindow.. but its giving an error saying object expected... can not figure out the problem,..
Here is the code
function openWin() {
var oWnd = radopen("~/catalog/myPage.aspx", "RadWindow1");
}
<td style="width: 130px;">
<telerik:RadWindowManager
ID="RadWindowManager1"
ShowContentDuringLoad="false"
VisibleStatusbar="false"
ReloadOnShow="true"
runat="server"
Skin="Sunset"
EnableShadow="true">
<Windows>
<telerik:RadWindow
ID="RadWindow1"
runat="server"
Behaviors="Close"
OnClientClose="OnClientClose"
NavigateUrl="~/catalog/myPage.aspx">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<div>
<asp:LinkButton ID="lnkProducts"
runat="server"
Visible="false"
OnClientClick="OpenWin()">Click Here to view your products</asp:LinkButton>
</div>
</td>
This is the e开发者_开发问答rror:
Microsoft JScript runtime error: Object expected
For starters the JavaScript function you attach to the OnClientClick of the linkbutton is not in the same casing as the one you declared above. Then you should cancel the postback from the linkbutton in order to let the RadWindow show, otherwise the page will immediately dispose and you will not be able to open the RadWindow.
Try this:
<asp:LinkButton ID="lnkProducts" runat="server" Visible="true" OnClientClick="OpenWin(); return false;">Click Here to view your products</asp:LinkButton>
and the JS:
function OpenWin()
{
var oWnd = radopen("~/catalog/myPage.aspx", "RadWindow1");
}
精彩评论