Jun 04, 2008 Home / ASP.NET Forums / General ASP.NET / Web Forms / make hyperlink open in new tab make hyperlink open in new tab [Answered] RSS 18 replies. How to Open any file in new browser tab using ASP.NET with C# Ajax Tab Container is not showing the browser Using a button and open a new browser tab in ASP.NET. Display PDF file from database in browser new window using ASP.Net; Display PDF file from database in browser new window using ASP.Net. Answered Active Solved. Ask Question. Last Reply on Apr 11. If i click on linkbutton pdf file should open in new tab. I don't know how to do dis. Oldest Newest Answered Liked. Re: Open PDF in new tab To be clear, whatever JavaScript you are emitting to the page, should show up when you do a view source. In the example that you have above, the problem lies with the use of this '~'.
Active2 months ago
This is the code for downloading the file.
When this code is executed, it will ask user to open or save the file. Instead of this I need to open a new tab or window and display the file. How can I achieve this?
NOTE:
Free download soal un biologi sma 2011 1. Besides, we also include Permendiknas no. 46 on the Implementation of UN 2011 and No game.
File won't necessary be located in the website folder. It might be located in an other folder.
Bobrovsky8,9771818 gold badges6262 silver badges113113 bronze badges
smilusmilu41144 gold badges2121 silver badges4343 bronze badges
7 Answers
Instead of loading a stream into a byte array and writing it to the response stream, you should have a look at HttpResponse.TransmitFile
If you want the PDF to open in a new window you would have to open the downloading page in a new window, for example like this:
janzijanzi
And
In javaScript:
Take care to reset target, otherwise all other calls like
Response.Redirect
will open in a new tab, which might be not what you want. Open Pdf In New Tab
NinaNina
KarthikKarthik1,88944 gold badges2525 silver badges6060 bronze badges
You have to create either another page or generic handler with the code to generate your pdf. Then that event gets triggered and the person is redirected to that page.
But it has one major flaw, as I see it. Biblia stuttgartensia online. This is a nice interlinear. It gives you the Hebrew script with the English below it.
YetimandaddyYetimandaddy
you can return a FileResult from your MVC action.
*********************MVC action************
**************js**************
Use formpost to post your data to action
You need to create a form to post your data, append it your dom, post your data and remove the form your document body.
However, form post wouldn't post data to new tab only on EDGE browser. But a get request works as it's just opening new tab with a url containing query string for your action parameters.
Harish MashettyHarish Mashetty
Here I am using iTextSharp dll for generating PDF file.I want to open PDF file instead of downloading it.So I am using below code which is working fine for me.Now pdf file is opening in browser ,now dowloading
If you want to download file, add below line, after this Response.ContentType = 'application/pdf';
Kashyap DiwanKashyap Diwan
Javascript Open Pdf In New Window
Polo GuyPolo Guy