I’m converting classic ASP over to ASP.Net, and came up with this error for one of the pages:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The 'Text' property of 'asp:TextBox' does not allow child objects.
Source Error:
Line 120: <tr>
Line 121: <td>Compliment Art:</td>
Line 122: <td><asp:CheckBox runat="server" ID="mail_Comp_Art" /></td>
Line 123: </tr>
Line 124: <tr>
As you can see, I have an asp:CheckBox element, but I am getting an error as if it is an asp:TextBox. I really don’t know what I’m doing wrong at this point, and am fairly tired now as well…
In the code behind, I am checking a variable, and if it’s set to true, I have:
mail_Comp_Art.Checked = true;
This is not showing an error, though, in Visual Studio. Any insight would be appreciated.
EDIT
Oh wow… Now that I am more awake, I noticed that I had some code commented out, and it was causing the issue. Although the error showed it was the code that was not commented out. Very odd. The actual error was on line 117. I don’t understand why it would have caused the error to begin with since it was commented out, or why it did not say it was that line instead of the one it does say is wrong…
Transferred from comment:
The error looks like there is an asp:TextBox control somewhere around line 118/119. Can you post some of the surrounding code? Usually the line produced in the error isn’t the actual problem but the first point at which the problem exposed itself.