Questions tagged [html.encode]

8 questions
5
votes
9 answers

why do i need to do html.encode()

if i have a user entering data into a rich text editor (tiny editor) and submitting data that i am storing into a database and then retrieving to show on other dynamic web pages, why do i need encoding here. Is the only reason because someone might…
leora
  • 188,729
  • 360
  • 878
  • 1,366
2
votes
2 answers

Change color based on value

I have a number of fields where I want to display the data in red if it is expired. <%= Html.Encode(String.Format("{0:d}", Model.Subcontract.insurance_GL))%> If the date is less than today's date, then I'd want it to display in red. What is the…
RememberME
  • 2,092
  • 4
  • 37
  • 62
2
votes
1 answer

Use html.encode for query string parameters

Is it a good practice to use html.encode before passing the query string parameters to the business layer? The scenario is with respect to asp.net framework, and I am wondering if I must encode the contents of query string or not before reading the…
1
vote
2 answers

Can I use the <%: tag on an application that will be hosted on IIS6?

Can I use the <%: tag on an application that will be hosted on IIS6? What about on an application targeted for .NET 3.5?
Raphael
  • 7,972
  • 14
  • 62
  • 83
0
votes
1 answer

Mvc3 Html.Encode and MarkdownSharp

I am using MarkdownSharp in an mvc3 project. The user is able to insert text into a textbox, that might be dangerous, so that he can write something like "2 < 3". So I am not able to block all dangerous inputs. To display the text, I want to encode…
Chris
  • 1,610
  • 3
  • 18
  • 37
0
votes
1 answer

Does Html.LabelFor or Html.TextBoxFor automatically call Html.Encode?

do I still need to call html.ecnode even if I'm only using Html.LabelFor and Html.TextBoxFor or similar function and not using the text directly?
AppDeveloper
  • 927
  • 11
  • 21
0
votes
2 answers

ASP.NET MVC2 -- How is Html.Encode() used?

How is Html.Encode() used? What is its purpose, and how is it useful?
DarkLightA
  • 14,980
  • 18
  • 49
  • 57
0
votes
2 answers

ASP vs Inc behavior difference with html.encode

For my current project i work with include files (.inc) inside visual studio. What i did is changed some inc files to asp. But when i consult my page i have a strange behavior with special characters. Examples André for André Priv� for privé When…
Kris Nobels
  • 1,977
  • 2
  • 14
  • 23