By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 833 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

Cross- Side Scripting and SQL data reader

P: n/a
I am using sqlDataReader for Showing data from the Data base
But if the Data from sql is having tags like <script>alert()</script> then it shows an alert box while binding

Is there any way of suppressing it this ..... ???

regard
Vineet Batt

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I think you're looking for the Server.HtmlEncode method.

http://msdn.microsoft.com/library/de...ncodetopic.asp

"vineetbatta" <an*******@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
I am using sqlDataReader for Showing data from the Data base.
But if the Data from sql is having tags like <script>alert()</script> then it shows an alert box while binding.
Is there any way of suppressing it this ..... ????

regards
Vineet Batta

Nov 18 '05 #2

P: n/a
No..... this approach can be used if u are retrieving value and binding to the control like label

Here i am having sqlDataReader object................... which connects to Data in sql D/B

E.g

ListDataGrid.DataSource = sqlReaderObject
ListDataGrid.DataBind()

-Vineet Batt
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.