Link forms in Visual Basic

Status
Not open for further replies.

Patrick.Kershner

Solid State Member
Messages
9
Location
Colorado Springs
Hello everyone,

I am tring to make a price check calculator and in order for me to do that i need my users to choose their price level.

Right now i have a small web form created and its quite simple but i need my button for onclick to do link to corresponding forms that it goes to...Right now i have it as:

Public



Partial Class WebForm1




Inherits System.Web.UI.Page




Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load




End Sub



Protected Sub pricelvl_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles pricelvl.SelectedIndexChanged

Message1.Text =


"" 'initialize Text property



Select Case pricelvl.SelectedItem.Text




Case "Please Choose"

Message1.Text &=

"Please Make A Selection"



Case "Business"

Message1.Text &=

"You Chose Business, Is this Correct"



Case "Residential"

Message1.Text &=

"You Chose Residential, Is this Correct"



End Select



End Sub



Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click




If Message1.Text = "Business" Then

Business.aspx()



Else

Message1.Text ="Residential"

residential.aspx()



End If



End Sub

End




Class

So basically when they click on business then click the next button, I want it to pull up the business form, and same for residential. Unfortationaly i am not that good with Visual Basic 2008 yet and i tried to find something online for it but there is no documentation for VB..



Any help would be appreciated



Thanks in advanced

Patrick
 
So to be clear, on the current form there is a residential button, and a business button, the user selects one, clicks next, and then the chosen form should load ?

If so, you could make the residential and business button assign a global variable as different values, for example

onclick_residential
optionvarb = 1

onclick_business
optionvarb = 2

onclick_next
if optionvarb = 1 Then
me.hide
residentialform.show
else
if optionvarb = 2 then
me.hide
bsuinessform.show
end if

Not quite sure what you mean, so sorry if i've totally misunderstood.

Oh, and that's kinda pseudo code, as we use VB6 for some reason at school, and it's probably a bit different.
 
Status
Not open for further replies.
Back
Top Bottom