|
-
Oct 23rd, 2002, 01:22 PM
#1
Thread Starter
Frenzied Member
page load event
this is in ASP.NET...but I'm using the codebehind page which is VB.NET
in the codebehind page I placed some code to fill my combo box, sorry that was 6.0 talk, my dropdownlist. Heres the code I'm using and it's the only code I have in the page load event.
Me.DropDownList1.Items.Add(New ListItem("Database1", "D"))
Me.DropDownList1.Items.Add(New ListItem("Database2", "P")
When I run my page I get double data in my dropdownlist from each line of code. I went into debug mode and it is in fact going through the code twice. It's goes to the end sub and then goes back to page_load and runs the same code again. Any reason why it's going through this procedure twice?
thanks,
eye
-
Oct 23rd, 2002, 02:08 PM
#2
Try testing for postback:
VB Code:
If Not Me.Postback() Then
Me.DropDownList1.Items.Add(New ListItem("Database1", "D"))
Me.DropDownList1.Items.Add(New ListItem("Database2", "P")
End If
-
Oct 29th, 2002, 09:27 AM
#3
Thread Starter
Frenzied Member
I'm trying to use the postback method and I'm getting an error that it's not a member of my app..
If Not Me.Postback() Then
Me.DropDownList1.Items.Add(New ListItem("Database1", "D"))
Me.DropDownList1.Items.Add(New ListItem("Database2", "P")
End If
-
Oct 29th, 2002, 11:01 AM
#4
Sorry its actually IsPostBack.
-
Oct 29th, 2002, 01:19 PM
#5
Thread Starter
Frenzied Member
postback stays false and it still goes through the code twice.
Anyone know why it would go through the page load code twice?
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
|