tags:

views:

16

answers:

1

I want to know how to handle executable scripts in a textbox / ckeditor / any input control.

For example, if I enter:

<script>alert('hi')</script>

How should I handle this script in the textbox / ckeditor / input control?

+1  A: 

If you use Visual Studio 2010 you'd better create text box with HtmlHelper (Note using <%:):

<%: Html.TextBox("name") %>

it will prevent you from JavaScript injection.

StuffHappens