Dec 12, 2013, 5:49 AM
[CLOSED] Error when assign datasource to store in user control
Hai Everyone..
I have little problem here. I have parent page let says A.aspx, and i have user control let says B.ascx. In Page A.aspx i call web service to get dataset, when i get it, i want to parsing to User Control B. I create some method in User Control B to store a dataset to combobox store. When i debug the User control page, i get error that says "Object reference not set to an instance of object.". Please look my attachment image on above.
This is my function in user control page :
I have little problem here. I have parent page let says A.aspx, and i have user control let says B.ascx. In Page A.aspx i call web service to get dataset, when i get it, i want to parsing to User Control B. I create some method in User Control B to store a dataset to combobox store. When i debug the User control page, i get error that says "Object reference not set to an instance of object.". Please look my attachment image on above.
This is my function in user control page :
Public Sub storeDataToCombo(ByVal ds As DataSet)
Try
Me.storeRole.DataSource = ds.Tables(2)
Me.storeRole.DataBind()
Catch ex As Exception
End Try
End Sub
And this is method from parent page :Public Sub CreateUser_Click(ByVal sender As Object, ByVal e As DirectEventArgs) Handles CreateUser.Click
Dim dsDropDown As New DataSet
extHelper.setUserControlContent(Window1, "ctrl_UserManagerWindowForm.ascx", Me.Form)
dsDropDown = BLM.blGetDropDown(Me.Session("AuthState"))
ctrl_FormInput.storeDataToCombo(dsDropDown)
Window1.Show()
'X.Js.Call("createWindow")
End Sub
Thanks for your attention. :)
Last edited by Daniil; Dec 18, 2013 at 2:30 AM.
Reason: [CLOSED]