Opening new tab using a link with querystring variable?
-
First of all, I am entirely new to web development, so I apologize in advance if this question is overly simple (although I did do the prerequisite googling before I posted). The problem I am having is that I would like to open a new tab via a link button or link on my page. I need to append a query string variable from the page onto the end of the reference, because it is passing a parameter to a report. I've successfully passed the parameter and opened the report in the same tab using this code: protected void lbSummary_OnClick(object sender, CommandEventArgs e) { Response.Redirect("http://myreportserverURL&rs:Command=Render&Year="+YearID); } And I've successfully opened the report in a new tab without passing the parameter with this code: <a href="http://myreportserverURL" target="_blank" class="menu">Report Name</a> I would prefer to do both. One important note is that opening a new window, instead of a new tab, is not what I need. I do understand that this is somewhat dependant on browser use, but for this project I can assume that users will be on IE8. Is this possible? Any suggestions would be greatly appreciated.
-
Answer:
You can use asp.net http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.hyperlink_properties%28v=VS.80%29.aspx where you can set it's NavigateUrl in code-behind to whatever link you want including your querystring in there. You can set it's Target Property as per you need.
badpanda at Stack Overflow Visit the source
Other answers
Set target="_tab" this will open link in new tab
Akash Kava
Related Q & A:
- how to open a link in new tab in chrome extension?Best solution by Stack Overflow
- How to programmatically open a new tab on Safari iPad?Best solution by whoknew.dk
- How do I open Javascript link in new tab?Best solution by Stack Overflow
- Can you force a link to open in a tab specific tab that is already open?Best solution by Stack Overflow
- How can you erase a link on the tab that I don't want to have anymore?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.