Reputation: 27
i have tried to close window(radWindow) using asp.net C#, but error on java script function is that 'object required' ,How can i solve this?
My java script and asp.net code is
<script type="text/JavaScript">
function Close() {
GetRadWindow().Close();
}
</script>
Asp.net code is
<asp:Button ID="btnSubmit" runat="server" Text="Submit Request" Height="27px" OnClick= "btnSubmit_Click" OnClientClick="Close();return false;" />
Optional try using C# for same operation as
C# code for button is
protected void btnSubmit_Click(object sender, EventArgs e)
{
//Server code
ScriptManager.RegisterStartupScript(this,GetType(), "close", "Close();", true);
}
Upvotes: 1
Views: 4628
Reputation: 6103
You call GetWindow()
but you don't have this function .
Just add this code ,
function GetWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
Upvotes: 1
Reputation: 749
This post may help you lot
i had same issues in the past but manged by the logic from the above post
Upvotes: 0