Re: WebPart Postback

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Sujath,

Like you suggested I tried to first write DropDownList Event to
populate the Dropdownlist. Check this:-
myDDL = New DropDownList
myDDL.AutoPostBack = True
AddHandler myDDL.SelectedIndexChanged, AddressOf Load_DDL
Controls.Add(myDDL)

Now in render webpart I don't do anything.

Now inside the button Event I write the Page.ispostback code.

Public Sub Load_DDL(byVal sender as Object, byval e As EventArgs)
' < ---- Here I open the Site and then in the same way pass it to the
dataset.
If Not page.IsPostBack then
myDDL.DataSource = dataset.Tables(0)
myDDL.DataTextField = "ABC"
myDDL.DataBind()
End Sub

Now this seems to not work at all. Here is what is happening. The Page
loads but with an empty dropdownlist. To change the working, I wrote
the same event for Button_Click Event method but nothing happens. What
am I doing wrong ?

Sujath, I know you will be irritated but your help has got me this far,
so if you just keep checking on the post that will be wonderful.

I will check the web config file for enable session state,
Thanks a million,

.


Quantcast