Reputation:
I'm creating a web page. I've added a textbox
at design time and changed its textmode
property to date.
I'm getting the following error when viewing it in a browser: (if i change the textbox property to "single line" I dont get the error)
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: Cannot create an object of type
'System.Web.UI.WebControls.TextBoxMode' from its string representation 'Date' for the 'TextMode' property.
Source Error:
Line 20: <tr>
Line 21: <td>
Line 22: <asp:TextBox ID="TextBox1" runat="server" TextMode="Date"></asp:TextBox>
Line 23: </td>
Line 24: <td> </td>
Upvotes: 2
Views: 6693
Reputation: 51
When you start the new project in Visual Studio IDE, please make sure that .Net Framework 4.5 or higher is selected. That way the project will support these additional features when run.
Upvotes: 0
Reputation: 7146
This is an alternative answer if you don't want to install the .NET FRK 4.5 :
Instead of using the attribute "TextMode", you can replace it by "type", which is the attribute's name in both cases in the generated "HTML Input"
Upvotes: 3
Reputation: 1456
Please installed .Net Framework 4.5, it will work fine.
Upvotes: 2
Reputation: 386
It seems you have not installed .Net Framework 4.5. Below .Net Framework 4.5 TextMode has only three mode i.e. SingleLine, Multiline and password.
Upvotes: 5