Click to See Complete Forum and Search --> : can someone help me with mutliple web forms


Mathie
03-08-2006, 04:01 PM
Hello everyone. I know that this must be an easy question, but I am a beginner with ASP.NET 2005. I have constructed 2 webforms and with one webform i have 2 textboxes which are then used to select certain data from an Xml feed off of a URL. I Have successfully done that and know that i have that working. The thing that i want to do now is make my one form not visible and change my view to my second form to display this data. However, for the life of me, i have no idea how to do this, how to make my Form1 invisible, and my Form2 visible. I dont want to use a PostBackURL because in my button from form1, i have a set of instructions that i want it to do before i go to my second form. So my main question is:

how can i bring this data to the 2nd form (which i have put into an array in the form1) and make the 2nd form visible after the things in the button method is done in the first form. thank you very much!

I should also note too that i am used to Visual Basic, and i was used to using the Form1.Visible = false, then Form2.Visible = true, but it doesnt seam to allowq me to chose form2, there is none in the autotype. is this normal? are different aspx files independent of each other?

PeOfEo
03-09-2006, 01:36 AM
You cannot put two forms in one aspx file, that is you cannot have two forms with runat=server AFAIK. But you can affectively use one form as if it is several, having command buttons do lots of things, or just write your forms with an aspx action the old way.

sirpelidor
03-09-2006, 02:57 PM
This can be done in a rather complex process, you will need to familiar yourself with a few concept first before you can implement exactly what you are asking for:
1) delegate
2) web user control (*.ascx)
3) passing variables from 1 ascx to another ascx within the same aspx form
3a)this can be done using public method within the object
3b)or can be done using session variable
3c)or can be done using http get method (meaning your first ascx form cause a post back with query string, and your second ascx will act on based on the query)
4)you will need to use panel to hold 2 ascx pages, first panel visable= true, when first ascx button is triggered, panel one visable = false and panel two visable = true....


this should give you a sense of direction where to go from here. Like PeOfEo suggested, just write your forms with an aspx action the old way or if you interested at the approach i'm suggesting (which you need to familiar with those concepts i've listed) you are welcome to continue post on this thread and ask more questions.