Avoid pop-up blocker settings when opening new Window.

Feb 11 2016 1:03 AM
Avoid pop-up blocker settings when opening new Window.
 
 
 
plz reply me fast new window opened but it is asking popupblocks how to resolve this prbm 
 
<script type="text/javascript">
function SetTarget() {
document.forms[0].target = "_blank";
}
</script>
 
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div class="SlideShowContentPanel clearfix" id="u114">
<!-- stack box -->
<%-- <a href="Images/jesse.jpg" target="_blank"><img src="Images/jesse.jpg"/></img></a>--%>
<asp:ImageButton ID="Image2" OnClick="Image2_Click" OnClientClick="SetTarget();" runat="server" Style="width: 500px; height: 364px;" />
<div class="SSSlide clip_frame clearfix grpelem" id="u234">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
 
 
 
c#code
....................
protected void Image2_Click(object sender, ImageClickEventArgs e)
{
string url = Image2.ImageUrl;
string script = string.Format("window.open('{0}');", url);
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"newPage" + UniqueID, script, true);
}
 
 
 
 
 
 
 
 

Answers (1)