I am new to VB .Net programming and is trying to create a webpage. I encountered the following error and is totally clueless on how to make it work:
==================ERROR=========================== =======
Object reference not set to an instance of an object.
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ICAPS_admin.WebForm1.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
================================================== =======
My webpage that I am trying to load is a very simple one which consist of only 3 dropdown list and 2 textbox. Below is my VB code:
==================Code ===================================
Expand|Select|Wrap|Line Numbers
- Public Class WebForm1
- Inherits System.Web.UI.Page
- #Region " Web Form Designer Generated Code "
- 'This call is required by the Web Form Designer.
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- End Sub
- Protected WithEvents LabelSearchGemSecNo As System.Web.UI.WebControls.Label
- Protected WithEvents txtBoxGemSecNo As System.Web.UI.WebControls.TextBox
- Protected WithEvents LabelSearchUserID As System.Web.UI.WebControls.Label
- Protected WithEvents txtBoxUserID As System.Web.UI.WebControls.TextBox
- Protected WithEvents LabelStatus As System.Web.UI.WebControls.Label
- Protected WithEvents LabelCAtype As System.Web.UI.WebControls.Label
- Protected WithEvents LabelIndicator As System.Web.UI.WebControls.Label
- Protected WithEvents ddlStatus As System.Web.UI.WebControls.DropDownList
- Protected WithEvents ddlCAtype As System.Web.UI.WebControls.DropDownList
- Protected WithEvents ddlIndicator As System.Web.UI.WebControls.DropDownList
- 'NOTE: The following placeholder declaration is required by the Web Form Designer.
- 'Do not delete or move it.
- Private designerPlaceholderDeclaration As System.Object
- Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
- 'CODEGEN: This method call is required by the Web Form Designer
- 'Do not modify it using the code editor.
- InitializeComponent()
- End Sub
- #End Region
- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 'Put user code to initialize the page here
- End Sub
- Private Sub ddlCAtype_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlCAtype.SelectedIndexChanged
- End Sub
- End Class
Can anyone advise on this pls?
Thanks and regards,
livmacca