2008年3月20日 星期四

要能讀取或寫入包含有 Html Tag的字串

問題(要能讀取或寫入包含有 Html Tag的字串)
This was added in .NET framework 1.1 and basically it means that you can't post values containing HTML ( or script ) tags to the server.

錯誤訊息:
A potentially dangerous Request.Form value was detected from the client

解決方法:加入以下這行web.config
pages validaterequest="false"

1 則留言:

腦袋鈍了只好靠電腦 提到...

為了要讀取Html Tag的語法必須將Validrequest設定成false。造成安全問題,所以建議改用BBcode的方法,就是將Tag裡的link中的<>替換成[]
[a href='#']link[/a]