3 月
29
29
showModalDialog 網頁做送出動作 (Submit/PostBack)
JavaScript 的window.showModalDialog語法,在網頁做送出動作(如Submit/PostBack)時,會另開新視窗,解決的方式是將 <base target=”_self”>加入<head>~</head>中間。
ASP.Net的寫法:
1、有MasterPage:
Page.Header.Controls.Add(new LiteralControl(@”<base target=””_self”” />“));
2、無MasterPage:
[ in the .cs page ]
protected string baseUrl = “<base href=\”_self\”>“;
[ in the .aspx page ]
<head>
<%= baseUrl %>
</head>
There are no comments.