TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Upendra Pratap Shahi
187
10.4k
2.1m
How to implement AntiXSS library in .net 4.5
Nov 9 2016 9:16 AM
I am facing issue when implementing AntiXSS library in .net 4.5.
Previously I've used this in .net4.0 from nuget package, when update from nuget package then this add two DLL,
AntiXssLibrary and HtmlSanitizationLibrary DLL.
After adding this I've used below name space :
using Microsoft.Security.Application;
after this I have called this as below :
string finalText1 = Sanitizer.GetSafeHtmlFragment(TesxtBox1.Text.Trim());
In textbox, I've entered below string :
XSS test <script>alert('upendra');</script>
and this throw below output:
XSS test
but when I've used in .net 4.5 then unable to find this method.
In 4.5 :
using System.Web.Security.AntiXss;
string finalText = AntiXssEncoder.HtmlEncode(
esxtBox1.Text.
Trim(),true);
and this encode
XSS test <script>alert('upendra');</script>
in
XSS test <script>alert('upendra');</script>
How to get desired output as throw in .net4.0 in 4.5 without using any DLL because AntiXSS is already inbuilt in .net 4.5.
Reply
Answers (
0
)
SQL urgent need help
How to Compress .ldf File ?