To prevent data from being submitted outside of the site, is to prevent data from being submitted from outside the site to the site. That is, if data page is not the site page for sending data, it is prohibited to receiving data.
The first method isCodeAdd enableviewstatemac = "true" at the top to prevent data from being submitted from outside the website. For example:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "common. aspx. cs" inherits = "manage_common" enableviewstatemac = "true" %>
This method basically solves the problem.
The second method isProgramTo prevent data from being submitted outside the website:
String server_v1 = convert. tostring (request. servervariables ["http_referer"]);
String server_v2 = convert. tostring (request. servervariables ["SERVER_NAME"]);
Int Changdu = server_v2.length;
If (server_v1.substring (7, Changdu )! = Server_v2)
{
Add a prompt to prohibit data from being submitted outside the website
}
Else
{
Add the program after submitting data from the website
}