We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,430 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to close asp.net window?

I want to write code behind by close button so when user click rhat button whole application is close... is it possible?

//this code is not giving right result...
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
    {

       Response.Write("<script language='javascript'>window.open('','_self',''); window.close();</script>");
       // Response.Write("<script language='javascript'>self.close();</script>");
        //Response.Write("<script language='javascript'> { self.close() }</script>");

       //Me.ClientScript.RegisterClientScriptBlock(Me.GetType(), "closemyself", "<script>self.close();</script>");


    }
2
Contributors
2
Replies
1 Hour
Discussion Span
10 Months Ago
Last Updated
3
Views
sania khan
Light Poster
34 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I never work in asp.net but i have some knowldge of asp.net so you have to try this code <asp:Button Id="btnOK" runat="server" AccessKey="<%$Resources:
wss,multipages_okbutton_accesskey%>" Width="70px" Text="<%$Resources:wss,
multipages_okbutton_text%>" OnClick="btnOK_Click" /> I think this code solve your problem.

touchweb
Newbie Poster
2 posts since Jul 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This code is giving error "The resource object with key 'multipages_okbutton_accesskey' was not found."

sania khan
Light Poster
34 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.1533 seconds using 2.7MB