You must Sign In to post a response.
Category: ASP.NET
#767322
Hi,
Try this:
.aspx:
.cs:
Try this:
.aspx:
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" / >
.cs:
protected void Button1_Click1(object sender, EventArgs e)
{
Response.Write("<script type='text/javascript'> window.returnValue = true;window.close();</script>");
}
#767326
Hi,
Refer below..
Hope this will help you
Regards,
SonyShiva
Never lose hope..You never know what tomorrow will bring
Refer below..
<script>
function closeWindow() {
window.close();
}
</script>
<button onclick="closeWindow()">Close</button>
Hope this will help you
Regards,
SonyShiva
Never lose hope..You never know what tomorrow will bring
#767343
Hi,
In your design you make this javascript code and call this function in your server side code behind.
and on cancel button click call the above function
Try something like above may be this may help you...
--------------------------------------------------------------------------------
Give respect to your work, Instead of trying to impress your boss.
N@veen
Blog : http://naveens-dotnet.blogspot.in/
In your design you make this javascript code and call this function in your server side code behind.
function CloseWindow() {
window.close();
}
and on cancel button click call the above function
protected void btnCancel_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "window.onunload = CloseWindow();");
}
Try something like above may be this may help you...
--------------------------------------------------------------------------------
Give respect to your work, Instead of trying to impress your boss.
N@veen
Blog : http://naveens-dotnet.blogspot.in/
Return to Return to Discussion Forum