6784
asked on
Object reference not set to an instance of an object.
Can yoy guys look at this very basic code and tell my I get this error.
Line 1583: 'End If
Line 1584:
Line 1585: If ddlCashAccount.SelectedIte m.Text = "" Then
Line 1586:
Line 1587: strScript = "<script>"
[NullReferenceException: Object reference not set to an instance of an object.]
iVMF.wfmMain.MissingRequir edFields() in c:\inetpub\wwwroot\VB\iVMF \wfmMain.a spx.vb:158 5
iVMF.wfmMain.btnVMSave_Cli ck(Object sender, EventArgs e) in c:\inetpub\wwwroot\VB\iVMF \wfmMain.a spx.vb:189 5
System.Web.UI.WebControls. Button.OnC lick(Event Args e)
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument)
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData)
System.Web.UI.Page.Process RequestMai n()
If ddlCashAccount.SelectedIte m.Text = "" Then
strScript = "<script>"
strScript = strScript & "alert('Invaild Cash Account! Cash Account is mandatory on Vendor Company tab.');"
strScript = strScript & "</script>"
Page.RegisterStartupScript ("ClientSc ript", strScript.ToString())
Exit Function
End If
I seem to be getting alot of these errors
6784
Line 1583: 'End If
Line 1584:
Line 1585: If ddlCashAccount.SelectedIte
Line 1586:
Line 1587: strScript = "<script>"
[NullReferenceException: Object reference not set to an instance of an object.]
iVMF.wfmMain.MissingRequir
iVMF.wfmMain.btnVMSave_Cli
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
If ddlCashAccount.SelectedIte
strScript = "<script>"
strScript = strScript & "alert('Invaild Cash Account! Cash Account is mandatory on Vendor Company tab.');"
strScript = strScript & "</script>"
Page.RegisterStartupScript
Exit Function
End If
I seem to be getting alot of these errors
6784
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, that could very well be the problem. I'm stepping through the vaildation code, without entering any data or selecting any items in the ddls.
Thanks for the quick response.
6784