QnA
|
사용언어 (칠해주세요) => (C#,VB) |
|
사용툴 (VS) : 비쥬얼2010 |
|
운영체제 (OS) : 윈도우7 |
|
상세언어(칠해주세요.) => 1) ASP.NET, 2) ASP.NET MVC, 3) ASP.NET AJAX |
이놈이 버튼을 클릭했을때 창을닫고 로그인패이지를 다시보여주는건대요
이해가안되는게 머냐하면요 저기밑에보시면
string script2 = "<script>window.opener = 'nothing'; window.open('Login.aspx','_parent',''); parent.window.close();</script>";
이부분있죠 이부분에서 저기 window.open('Login.aspx','_parent',''); 이부분을 써주지않으면 메세지를 뿌리고 닫거든요
그래서 저부분에다가 parent.window.close 이부분으로 바꾸어주어도 안되구요 꼭 window.open을 해줘야하던대 왜그런지 모르겠어요 그리고 저기 괄호안에 _parent 이분분도 멀말하는건지 모르겠네요 일단 되니까 쓰긴했는데 ㅋㅋ;;;;;;;;
인터넷에 검색해보니까 뭐 window.opener = nothing; / window.opener = ""; / window.opener = null; /
window.opener = self; 자바스크립트에서 저런식으로 써주면 윈도우창안뜨고 닫을수있다던대 전안되더라구요 ㅋㅋ;;;
cs에서 이렇게 쓰면 해결되긴하네요 (로그아웃버튼)
protected void Button1_Click(object sender, EventArgs e)
{
ClientScriptManager sm = Page.ClientScript;
string script2 = "<script>window.opener = 'nothing'; window.open('Login.aspx','_parent',''); parent.window.close();</script>";
sm.RegisterStartupScript(this.GetType(), "sm", script2);
Response.Write("<script>window.open('Login.aspx');</script>");
}