Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am trying to do a Web Base Application and I wanted to reload a web form that has its same size and location as before it was closed. Is this possible with asp .net?

Thank You!
Posted

1 solution

A page does not have position and size; this is the attribute of the Web browser window.

Such things are possible, but I would not recommend it. And they are not related to ASP.NET. This is all about Javascript. Please see:
http://www.w3schools.com/jsref/met_win_open.asp[^],
http://www.w3schools.com/jsref/obj_window.asp[^],
http://www.w3schools.com/jsref/met_win_resizeby.asp[^],
http://www.w3schools.com/jsref/met_win_resizeto.asp[^],
http://www.w3schools.com/jsref/met_win_moveby.asp[^],
http://www.w3schools.com/jsref/met_win_moveto.asp[^].

Note that you can return a window object if you create a new one any modify your size/location later.

Why this stuff is not good to deal with? First of all, with the advent of tabs (which are very good), in general case, you don't know what is the window of your page. It could be a tab page. Even if you window.open (which is itself not recommended some cases, because the users usually don't like popups), you can actually create either a separate window, or a tab. It depends on the parameters of the call; and the result probably depends on the browser (anyway, I never heard that this aspect was ever standardized or even documented).

This is really a good idea to leave the location of the window or a tab to the user.

—SA
 
Share this answer
 
Comments
kass dionisio 15-Apr-14 4:29am    
I really need this type of behavior. If you can tell me how, please help, I much appreciated it.
Sergey Alexandrovich Kryukov 15-Apr-14 11:02am    
I explained it all in first part of my answer, with links. What seems to be unclear?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900