|
-
Mar 1st, 2002, 02:17 PM
#1
Thread Starter
Member
maybe this is a dumb ?
How do you navigate between webforms in vb.net in a project I dont see any way to show or hide them and I dont see anyone to access them as object and I dont see any submit button. Maybe im jsut missing something.
-
Mar 1st, 2002, 10:29 PM
#2
with webform controls..add an on_click attribute with a function to call to a button
<asp:button name="button1" value="click" on_click="sub1" runat="server"/>
then just put the function withing a script tag
<script language="VB" runat="server">
Public Sub sub1()
End Sub
</script>
you can access the objects by there name in the sub..like if you have a textbox named text1
a = Text1.Text
web forms are event driven now..when the on_click is fired the page is reloaded from the web server calling the sub you state.
-
Mar 2nd, 2002, 09:07 AM
#3
Hyperactive Member
navigating between forms
Oops upon reading the query again I see it was web forms not win forms, anyway I'll leave the post as it stands
Yes, it had me scratching my head as well, now I don't know if this is the best way or not, but it does at least work
'Menu item Customers: Add
Dim AddCustomer As New AddCustomer()
AddCustomer.Show()
Me.Visible = False
I have a main menu screen and another form call AddCustomer
then coming back from the AddCustomer Form, I put in:
In the click button event
.the name of my main menu form
Dim Chelwood As New Chelwood()
Chelwood.Show()
Me.Close()
closing the application is a pain as well, in fact I ended up writing this:
in the click button event for my logout function
Me.Close()
End
Now I'm prettry much a newbie at this myself, so if there are better ways of doing, then please someone else post as well
Hope this helps and it least it does work
-
Mar 2nd, 2002, 02:32 PM
#4
Thread Starter
Member
Ill take a look at this at work monday. I think the way IIS appliations handled things with pages was a bit easier to understand. How would you make a call to a second web form in a project.
-
Mar 4th, 2002, 12:22 PM
#5
Thread Starter
Member
I found the answer
There are two ways that I know of navigating through webforms, first way is to remove the runat server tag from the form then this will work like a normal html form if u dont not do this it will always postback to the however if you do do this then your page wont postback on any controls you make.
The other way is to use response.redirect(url) this will then take you to the next page you want to go to If any one else has a better way to do this or whatever please post
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
|