-
Apr 1st, 2020, 05:17 PM
#1
Thread Starter
Junior Member
Using multiple web forms
My application opens a second web form to do calculations. I use Response.Redirect to open the second page.
When returning to the first page, I need all the values to be retained. In order to do this, the Return button (btnClose) in the second form uses this in Page_Load:
Code:
btnClose.Attributes.Add("onClick", "javascript:history.back(); return false;")
This makes btnClose work as if the user clicked the back button.
This works great except for one thing. Once returning to to the first web page, a click on any button re-opens the previous, second web form.
I am sure that there is a better way to do this, I can open the second page as a pop-up using JaveScript. This leaves the first page open, which is great. But what I cannot figure out is how to close the second page after being done with it.
Any help would be greatly appreciated!
-
Apr 1st, 2020, 09:03 PM
#2
Re: Using multiple web forms
You're asking in the desktop forum. Try the ASP.Net forum...
http://www.vbforums.com/forumdisplay...d-ASP-NET-Core
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 1st, 2020, 09:31 PM
#3
Re: Using multiple web forms
Originally Posted by .paul.
I have already asked the mods to move this thread to that forum, so please don't create a duplicate thread.
That said, the VB.NET forum is not for desktop apps specifically. If a question relates to code in a web app but it is about VB.NET generally, e.g. string manipulation or data access, then this is still an appropriate place for it. If the question is specific to ASP.NET though, e.g. relates to JavaScript as well as VB.NET, then the dedicated ASP.NET forum is the place for it.
-
Apr 1st, 2020, 09:33 PM
#4
Re: Using multiple web forms
Ok vb general, but mostly desktop...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 2nd, 2020, 04:23 AM
#5
Re: Using multiple web forms
Thread moved to the 'ASP.Net' forum, which is where questions about .Net web pages etc belong
-
Jun 26th, 2020, 03:50 AM
#6
Lively Member
Re: Using multiple web forms
Hello,@thorskonnord
It is indeed a shortcoming of WebForms. In ASP.NET MVC you can implement as many forms as you want (and it is valid & correct behavior of web pages).
The reason all server controls are placed inside <form> tag is to allow the WebForms engine to recognize them, load their values & save their values from/to the ViewState. Almost all infrastructure of control management in WebForms is based on the idea that a tag contains everything you access from the code-behind.
I hope this information will be useful.
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|