Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP.NET (http://www.go4expert.com/forums/asp-net/)
-   -   how to open a new browser window (http://www.go4expert.com/forums/browser-window-t20078/)

shyam_oec 13Nov2009 08:28

how to open a new browser window
 
dear sir,
i want to open a new browser window at the click of the button/link in asp.net using C#.
kindly explain the detailed procedure for the same.thanking you

venami 15Nov2009 07:11

Re: how to open a new browser window
 
Hi,

If you can achieve this using a simple Javascript.

Code:

<form action="" method="post">
<input type="submit" value="submit" onclick="window.open();" />
</form>


urstop 19Nov2009 21:15

Re: how to open a new browser window
 
As Venami has mentioned you can use the onclick if its a normal html control, but, if its a .NET button or link button control you will have to use the onclientclick instead of onclick. Everything else remains the same.

shyam_oec 20Nov2009 05:33

Re: how to open a new browser window
 
thanks

venami 22Nov2009 21:09

Re: how to open a new browser window
 
Hi Urstop,

Since I have used the Javascript, should the onclick event be changed as you said for .NET?
Won't Javascript work with .NET?

raqman 11Dec2009 21:51

Re: how to open a new browser window
 
current browser security settings require that a window only be opened from
href with a target, or client script tied to a onclick event. this prevents
the old trick of spewing inline javascript to open the window.

you need to find another approach. you should pass the id down in the
original render, and have client script determine the correct value, or just
render a link the user clicks on to open the window.

__________________
RAQ ReportFree Excel-like Web-based Java reporting tool


All times are GMT +5.5. The time now is 17:21.