I have an ASP.NET application with the code behind written in C#. I'm trying to figure out how to open a new browser window when a user selects a menu option. Right now I have the command:
The problem is that this opens the pdf in the same browser window when, instead, I would like to open the pdf in a new browser window.
How can I do this?
I am not sure what you mean by 'selects a menu option' - so I am presuming that you mean a button.
e.g. (sorry, only know how to do this in vb.net, but the code should be easy enough to translate)
''The return false part stops a postback from happening.
myMenuButton1.attributes.add("onclick", "window.open('documents/Emplyee.pdf'); return false;")
Sub myMenuButton1 Handles myMenuButton1.Click
Intelligence is a burden.
Jagdip Singh Ajimal
Manchester (and yes, I am a Manchester United fan)