G
Guest
Hi,
I'm encounted problem deal with dropdownlist databinding..
below is my code:
Dim ddlPerName As DropDownList
ddlPerName = CType(e.Item.FindControl("A"), DropDownList)
Dim ddpN As ArrayList = BindPersonName()
ddlPerName.DataSource = ddpN
ddlPerName.DataBind()
Error message as below:
Server Error in '/TestWeb1' Application
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Source Error:
Line 143: 'ASSIGN THE ARRAY LIST TO THE DROPROWNLIST.
Line 144: 'ddlPerName.DataSource = ddpN
Line 145: ddlPerName.DataBind()
Line 146: dd.DataSource = ddpN
Line 147: dd.DataBind()
Source File: c:\inetpub\wwwroot\TestWeb1\WebForm7(RImage).aspx.vb Line:
145
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
TestWeb1.WebForm7.DataGrid2_EditCommand(Object source,
DataGridCommandEventArgs e) in
c:\inetpub\wwwroot\TestWeb1\WebForm7(RImage).aspx.vb:145
System.Web.UI.WebControls.DataGrid.OnEditCommand(DataGridCommandEventArgs
e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs
e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1292
why ?? any ideas..
thanks in advance.
daniel.
I'm encounted problem deal with dropdownlist databinding..
below is my code:
Dim ddlPerName As DropDownList
ddlPerName = CType(e.Item.FindControl("A"), DropDownList)
Dim ddpN As ArrayList = BindPersonName()
ddlPerName.DataSource = ddpN
ddlPerName.DataBind()
Error message as below:
Server Error in '/TestWeb1' Application
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Source Error:
Line 143: 'ASSIGN THE ARRAY LIST TO THE DROPROWNLIST.
Line 144: 'ddlPerName.DataSource = ddpN
Line 145: ddlPerName.DataBind()
Line 146: dd.DataSource = ddpN
Line 147: dd.DataBind()
Source File: c:\inetpub\wwwroot\TestWeb1\WebForm7(RImage).aspx.vb Line:
145
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
TestWeb1.WebForm7.DataGrid2_EditCommand(Object source,
DataGridCommandEventArgs e) in
c:\inetpub\wwwroot\TestWeb1\WebForm7(RImage).aspx.vb:145
System.Web.UI.WebControls.DataGrid.OnEditCommand(DataGridCommandEventArgs
e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs
e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1292
why ?? any ideas..
thanks in advance.
daniel.