Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Box Property cannot be changed

Tags:

c#

asp.net

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>

2 Answers

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.

like image 64
user1990587 Avatar answered May 30 '26 15:05

user1990587


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"

like image 37
Sebastien H. Avatar answered May 30 '26 15:05

Sebastien H.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!