|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Another basic question: How to call and show one Web Form from another Web Form?developer). I've got an ASP.NET Form (Web Form) that contains various info/controls. One of these controls is a "Continue" button. I want to load another ASP.NET Web Form in my project when the "Continue" button is pressed. I can add VB.NET code to the bn_Continue_Click event such as: Private Sub bn_Continue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bn_Continue.Click Dim MyWebForm As New AWebForm ' What do I use to load MyWebForm in the current browser window? End Sub This is very basic, but I've read two ASP.NET books and searched for a solution and so far all seem to require HTML based coding that loads the AWebForm.aspx in a separate browser window (which is NOT what I want)? Also, am I being unrealistic in wanting to NOT keep resorting back to HTML coding? I find the HTML syntax mind boggling, difficult and time consuming to sift thru, and just very confusing and verly syntax heavy. Thanks, Rob. You can do it with one line of code, such as these:
Response.Redirect("WebForm2.aspx") 'or Server.Transfer("WebForm2.aspx") Show quoteHide quote "Rob R. Ainscough" <roba***@pacbell.net> wrote in message news:eAREJOGcFHA.2212@TK2MSFTNGP14.phx.gbl... > I'm new to ASP.NET and Web Development (Primarily a VB6, VB.NET, SQL > Server developer). > > I've got an ASP.NET Form (Web Form) that contains various info/controls. > One of these controls is a "Continue" button. I want to load another > ASP.NET Web Form in my project when the "Continue" button is pressed. > > I can add VB.NET code to the bn_Continue_Click event such as: > > Private Sub bn_Continue_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles bn_Continue.Click > > Dim MyWebForm As New AWebForm > > ' What do I use to load MyWebForm in the current browser window? > > End Sub > > This is very basic, but I've read two ASP.NET books and searched for a > solution and so far all seem to require HTML based coding that loads the > AWebForm.aspx in a separate browser window (which is NOT what I want)? > > Also, am I being unrealistic in wanting to NOT keep resorting back to HTML > coding? I find the HTML syntax mind boggling, difficult and time > consuming to sift thru, and just very confusing and verly syntax heavy. > > Thanks, Rob. > > > > Rob,
As Steve has pointed out you can use on of the above two methods. One thing that you may want to consider is the use of panels. Panels simply provide an alternative to the splitting of pages and can offer a wizard style approach in a single page. For instance, let's say that you have two panels. The first panel contains a form where users fill out their personal information. This panel is set to visible and has a continue button on it. Panel2 contains employment information that the user will fill out. This panel is initially marked with its visible property as false. Once the user fills in their personal information and clicks the continue button, you could simply do: Panel1.Visible = False Panel2.Visible = True Thus hiding the personal information panel and showing the employment information panel. Again, this might not be desired, but I wanted to offer you an alternative that I have found helpful when designing Web applications. Aaron Steve & Aaron,
Thank you for the response, yes the Response.Redirect works great! I was thinking of using panels, but the processing I'm going thru requires some pages that require more than a Panel can offer (in terms of physical readability). ASP.NET and Web development is all new to me, so I've got this love/hate thing going on with it :) Rob. Show quoteHide quote "Aaron Corcoran" <acorco***@lasers.state.la.us> wrote in message news:1118752892.458358.142200@g14g2000cwa.googlegroups.com... > Rob, > > As Steve has pointed out you can use on of the above two methods. One > thing that you may want to consider is the use of panels. Panels > simply provide an alternative to the splitting of pages and can offer a > wizard style approach in a single page. For instance, let's say that > you have two panels. The first panel contains a form where users fill > out their personal information. This panel is set to visible and has a > continue button on it. > > Panel2 contains employment information that the user will fill out. > This panel is initially marked with its visible property as false. > > Once the user fills in their personal information and clicks the > continue button, you could simply do: > > Panel1.Visible = False > Panel2.Visible = True > > Thus hiding the personal information panel and showing the employment > information panel. > > Again, this might not be desired, but I wanted to offer you an > alternative that I have found helpful when designing Web applications. > > Aaron >
Custom Controls & Javascript
DataGrid with edititemtemplate What happened to Alignment property? RadioButton in 2 GroupNames? Specifying Width and Height properties as percentages navigate through multipage hiddenfield / htmlInputHidden ? more than one webroot Getting the ApplicationInstance in webcontrol? Help Problems with ListBox Control |
|||||||||||||||||||||||