D
DC
In HTML page, I put:
<html>
<head>
<title>Article: <asp:Label ID="lblHTMLTitle"></asp:Label> </title>
....
In the code behind:
....
#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 lblHTMLTitle As System.Web.UI.WebControls.Label
....
cmdSQL = New SqlCommand(sSQL, connADO)
connADO.Open()
cmdReader = cmdSQL.ExecuteReader
If cmdReader.Read() Then
lblHTMLTitle.Text = cmdReader.Item("Title").ToString()
...
.....
But each time it hits: lblHTMLTitle.Text =
cmdReader.Item("Title").ToString(), it gives me the following error message:
Object reference not set to an instance of an object.
Any ideas why is this happening?
Or can't <asp:label> put in <title> tag?
<html>
<head>
<title>Article: <asp:Label ID="lblHTMLTitle"></asp:Label> </title>
....
In the code behind:
....
#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 lblHTMLTitle As System.Web.UI.WebControls.Label
....
cmdSQL = New SqlCommand(sSQL, connADO)
connADO.Open()
cmdReader = cmdSQL.ExecuteReader
If cmdReader.Read() Then
lblHTMLTitle.Text = cmdReader.Item("Title").ToString()
...
.....
But each time it hits: lblHTMLTitle.Text =
cmdReader.Item("Title").ToString(), it gives me the following error message:
Object reference not set to an instance of an object.
Any ideas why is this happening?
Or can't <asp:label> put in <title> tag?