this is my following code:
<tr id="trPrice" style = "display:none;">
<td colspan=2></td>
<td><b>Price:</b></td>
<td><asp:textbox id="txtPrice" runat="server" style = "border-style:none"></asp:textbox></td>
</tr>
And in my Code behind I want to set the style of the trPrice to "display:inline" at a specific page_load ->
Protected WithEvents txtPrice As System.Web.UI.WebControls.TextBox
' In Page_Load function:
If type = 3 Or type = 4 Then
trPrice.Attributes.Add("style", "display:inline")
End If
But this error occurs:
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.
runat="server"to make thistravailable for code-behind - Andrei