dvnews里这行为什么要删除

fanmeng 2004-04-16 02:32:29
1在dvnews里<pages validateRequest="false" />这行为什么在.net SDK 1.0及以前版本下使用dvnews时要删除,他到底起什么样的作用,
2.而我使用一个<asp:radiobuttonlist id="RadioButtonList1" runat="server" Width="102px" Height="15px" RepeatDirection="Horizontal" RepeatColumns="11">
<asp:ListItem Value="<img src="img\e0.gif"/>" Selected="True"><img src="img\e0.gif"/></asp:ListItem>

<asp:ListItem Value="<img src="img\e1.gif"/>"><img src="img\e1.gif"/></asp:ListItem>
......省略......

</asp:radiobuttonlist>
我的环境是.net sdk1.1,他报错:
A potentially dangerous Request.Form value was detected from the client (RadioButtonList1="<img src="img\e0.gif...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (RadioButtonList1="<img src="img\e0.gif...").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (RadioButtonList1="<img src="img\e0.gif...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +217
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87

当我在webconfig里加入上面那行<system>...<pages validateRequest="false" />...</system>就正常了,这是怎么回事情,谢谢各位了
...全文
160 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xlander 2004-07-31
  • 打赏
  • 举报
回复
cnleov(day day up)

那么如果1.0里允许输入html该怎么办?
fanmeng 2004-04-16
  • 打赏
  • 举报
回复
<asp:ListItem Value="<img src="img\e1.gif"/>"><img src="img\e1.gif"/></asp:ListItem>这个我是用vs.net直接在items里设置的啊,是他生成的代码?请教设置错在哪里,该怎样设置?
cnleov 2004-04-16
  • 打赏
  • 举报
回复
因为它提交的数据要允许HTML字符


楼主看看单词的意思了
validateRequest不就是验证请求嘛(如果提交的数据有HTML字符就会引发异常)
默认是验证的
而<pages validateRequest="false" />就是关掉验证
允许数据含有HTML字符

这个设置是在1.1中新加的
1.0不认,会出错,所以删掉阿
nnh 2004-04-16
  • 打赏
  • 举报
回复
1.第一個當你添加如<asp:Textbox id="runat" runat="server"/>控件內容到數據機中時,<pages validateRequest="false" />時,程序不會發生錯誤.如果要它默認的值的話,那程序就會出現不讓一個控件加入到數據庫中的提示.在.net SDK 1.0及以前版本不支持該屬性.

2.Value="<img src="img\e0.gif"/>" Selected="True"><img src="img\e0.gif"/> 這樣的格式有錯吧.不應該是這樣設的.
fanmeng 2004-04-16
  • 打赏
  • 举报
回复
我在顶,顶,顶,顶
shisanjin 2004-04-16
  • 打赏
  • 举报
回复
fanmeng 2004-04-16
  • 打赏
  • 举报
回复
都没人回答呢, 我自己顶了,up,up,up,up,up,up,up,up,up,up,up,

62,253

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧