我是使用 asp.net 动态数据应用程序的新手。我刚刚从我的架构生成了一个简单的应用程序,在一个表中我尝试插入一条记录,其中一个字段是 varchar(255) 字段。我发现任何带有“<”的输入当您尝试保存它时,其中的字符将导致应用程序抛出错误,但 if "<" 除外。是输入字符串中的最后一个字符。
由于 editinsert 函数是一些基于 ajax 的调用,它只是给了我一个通用的 javascript 错误,指示它尝试为更新而命中的任何 Web 服务抛出了 500 错误,我不知道如何调试它。
I'm new to using asp.net dynamic data apps.. I just generated a simple app from my schema, and in one table I'm trying to insert a record where one of the fields is a varchar(255) field. I am finding that any input that has the "<" character in it will cause the app to throw an error when you try to save it, with the exception being if "<" is the last character in the input string.
Since the editinsert function is some ajax based call, it just gives me a generic javascript error indicating whatever webservice it tried to hit for the update threw a 500 error and I have no idea how to debug this.
发布评论
评论(1)
我猜这是两件事之一:
1 - 您正在触发 asp.net 的内置请求验证。您可以通过将以下内容添加到页面来关闭它:(
您可以在 http://www.asp.net/%28S%28ywiyuluxr3qb2dfva1z5lgeg%29%29/learn/whitepapers/request-validation/)
或
2 - 你不是使用参数化 SQL 查询,因此您可以执行以下操作:
当“输入”中包含 SQL 运算符(例如“>”)时,这会导致无效 SQL
I would guess it's one of two things:
1 - You're triggering asp.net's built-in request validation. You can turn it off by adding the following to your page:
(You can read more about it at http://www.asp.net/%28S%28ywiyuluxr3qb2dfva1z5lgeg%29%29/learn/whitepapers/request-validation/)
OR
2 - You're not using parameterized SQL querys so your doing something like:
And this is causing invalid SQL when "input" has an SQL operator in it (such as ">")