user2042360
user2042360

Reputation:

Text Box Property cannot be changed

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>&nbsp;</td>

Upvotes: 2

Views: 6693

Answers (4)

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

Sebastien H.
Sebastien H.

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

Sharique Hussain Ansari
Sharique Hussain Ansari

Reputation: 1456

Please installed .Net Framework 4.5, it will work fine.

Upvotes: 2

user1990587
user1990587

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

Related Questions