2011-05-30 169 views
2

我想使用response.redirect在新窗口或選項卡中打開頁面。我嘗試了以下的事情。 1)用戶response.redirect在新選項卡或窗口中打開鏈接

<asp:ImageButton ID="createPanelBtn" runat="server" ImageUrl="~/Resources/User.ico"  Height="23px" ToolTip="Create Interviewer Panel" CommandName="createPanelBtn" 
CommandArgument=" <%#((GridViewRow)Container).RowIndex %>" Width="20px" OnClientClick="aspnetFrom.target='_blank';"/> 

2)

Response.Write("<script>window.opem('~/HR Administrator/ConfirmationEntryForm.aspx?VacId=" + strVacId + "&CompId=" + strCompId + "&DeptId=" + strDeptId+")'</script>"); 
Response.End(); 

在沒有的情況下,我能夠實現這個目標。請告訴我一些方法來做到這一點...

+1

是否僅在此處或在您的源代碼中存在拼寫錯誤? '「

0
<asp:LinkButton ID="lnkbtnvd" runat="server" Text="View Details" OnClientClick="javascript:window.open('viewclient.aspx', 'windowname', 'width=400,height=200,scrollbars=yes');" ></asp:LinkButton> 

使用你的參數

0

我發現了一個完美的解決方案!這是一種解決方法,但爲我工作。

設置打開的新時代如下按鈕的OnClientClick屬性:

的OnClientClick =「window.document.forms [0] = .TARGET '_空白'; setTimeout的(函數(){window.document .forms [0] .target ='';},500);「

它使用setTimeout將變化恢復到原來的狀態!

希望這可以幫助別人!

相關問題