Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Hi,
How to enable HTML property to a multiline textbox?
I want to use html tags in my text box. How can it be possible?
Posted
Updated 20-Jul-11 19:25pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Jul-11 0:39am    
???
shefeekcm 21-Jul-11 0:48am    
What do you mean?
Neha Thanka 21-Jul-11 1:01am    
Whenever I am entering html tags into the textbox, there is an error occurs like this:A potentially dangerous Request. How to solve this?

In your page you set <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ValidateRequest="false" %>

in apove .aspx page set <b>ValidateRequest="false"</b> like above.
 
Share this answer
 
Comments
Neha Thanka 21-Jul-11 1:30am    
Thank you very much......
This solution is working for me....
If you are looking for length properties then I must tell you that TextBox's MaxLength does not work when TextMode=MultiLine.
 
Share this answer
 
Hi,
There is no property for mutlitline textbox for input type Text, in html we have seperate tag called

here is the example:

XML
<textarea rows="2" cols="20">
Hi this is tajuddin software developer
Hi this is tajuddin software developer
</textarea>
 
Share this answer
 
To answer your question, I assume you would like to know How to set Multiline property of a Asp.Net TextBox?

1. If that's right following code will do the job,

<asp:TextBox ID="txtAmbiguous" TextMode="MultiLine" runat="server"></asp:TextBox>

2. If you would like to set MultiLine property from code behind then,

txtAmbiguous.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine;

Or otherwise please rephrase the question to get answer.

Hope it helps :)
 
Share this answer
 
hi,
writ this in te web.conig
XML
in the web.config for your entier application:
<system.web>
<page validateRequest="false" />
</system.web>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900