User311495996 posted
I followed this tutorial:http://www.mikesdotnetting.com/article/159/webmatrix-protecting-your-web-pages-site
created a new folder named "App_Code"
and created a new file named "HtmlSanitizer.cs", placed some c# code in it, including public of AssafeHtml
after that I created a new file to display a column in the database, codes like below:
@{
var db=Database.Open("database name");
var sql= db.QuerySingle("SELECT * from test order by id desc");
var qq= sql.columnname;
var qqq= new HtmlString(qqq.ToString().AssafeHtml());
}
<h1>@qqq</h1>
When I run it in browser, the yellow screen of death is appeared.
It mention me:
'string' does not contain a definition for 'AssafeHtml'
How can I do?
thanks for your help!