tags:

views:

1490

answers:

4

how to open a pop up window in code behind(C#) without using javascript.

+1  A: 

Besides the fact that popups piss off a lot of people, it is not really possible to do so (if you don't consider target="_blank") without using javascript. Code written in code behind only generates client side code (which can include javascript) or executes some serverside stuff.

There might be other workarounds using flash or silverlight but I'm not sure about that. Maybe if you clarify your goal a little bit more I can give a better solution to your problem.

Tomh
So essentially, putting target="_blank" in your <a> tag will achieve it for you.
ck
A: 

I do not think that is possible . what you can do offcourse is to open a new window with defined small width/height and all menus are stripped...

ThorHalvor
+1  A: 

The code behind runs on the server; you need the popup to appear on the client machine. Therefore your code behind can't trigger a popup.

Also, if you use javascript you'll probably find that the client's popup blocker prevents the new window from appearing (unless the popup happens as a direct response to a click - without posting back - in which case you can use <a target="_blank"...> if you really don't like javascript).

teedyay
+2  A: 

That is impossible because of "The code behind runs on the server; you need the popup to appear on the client machine. Therefore your code behind can't trigger a popup".

Alternatively, you can show a panel in the page as pop-up window, by seting it's z-index and giving absolute position.

Sessiz Saat