c# - Redirect to new tab in ASP.NET -
<asp:linkbutton id="lnkbtnprint" runat="server" onclick="lnkbtnprint_onclick" target="_blank"> </asp:linkbutton>
i have button. need open new tab content on click.
protected void lnkbtnprint_onclick(object sender, eventargs e) { if (!string.isnullorempty(hdnsubmissionid.value)) { sessionhelper.set(sessionkey.submissionid, hdnsubmissionid.value); response.redirect(publisherconfigurationmanager.navigation + "printable_submission_document.aspx"); } }
i try apply answer post opening url in new tab case, text in top-left corner 'window.open...'.
add _blank
link - doesn't help.
you dynamically redirecting based on triggered click. think scenario, change set href before click, since know data on page load, provided sample code complete.
public void page_load() { if (!string.isnullorempty(hdnsubmissionid.value)) { sessionhelper.set(sessionkey.submissionid, hdnsubmissionid.value); lnkbtnprint.href = publisherconfigurationmanager.navigation + "printable_submission_document.aspx"); } }
keep target set way , remove onclick event link button. should open "dynamic" target in new window.
Comments
Post a Comment