How to troubleshoot the refresh button problem in asp.net and the SQL injection problem in the URL.

Source: Internet
Author: User
Tags sql injection
asp.net| Button | solve | refresh | problem

All along, asp,php the processing of submitting data to another page, because it takes a lot of effort to deal with the decision in the page. This makes it possible to implement a small function with a lot of files, while benefiting from repeated submissions when submitting forms or deleting data.
The introduction of ASP.net makes this issue a reverse change, asp.net events and event delegates, the program can easily know that the user is clicked on the button and processed accordingly. That's the problem. The page refresh operation is an operation within the browser because the browser does not issue any external notifications for the event or callback. The program does not know whether the user is a button or a refresh, submits the form or deletes the data when it is submitted repeatedly.
There are also direct one in the ASP.net, then 1 and 1 are wrong, but to be in the URL of the value, such as after test.aspx?test=2, 1 and 1 will not be an error.

For refresh problem, we can refer to http://www.microsoft.com/china/msdn/library/webservices/asp.net/BedrockAspNet.mspx

If you don't use his refresh judgment, just ask your Web page to be able to prevent SQL injection.

You just have to join in your web.config.

<appSettings>
<add key= "Sql_banfilename" value= "banfilename.htm"/>//if the URL of the current request? There are SQL keywords after

Jumps to the current page.
</appSettings>
<system.web>
<add name= "Module" type= "My.Refresh.RefreshModule, Refresh"/>//http the request to the page's inheritance class processing.
</system.web>

I have not yet found the space to put the program and source code, interested friends can emai to qugui@163.com. Big this together discuss ASP.net technology



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.