by tesagen
26. april 2010 19:10
Hvis HTML elementer skrives i tekstfelt til ASPX sider så kommer det feilmelding.
Dette kan endres ved å stte følgende side deklarasjon:
ValidateRequest="false"
<%@ Page Language="vb" AutoEventWireup="false" ValidateRequest="false" CodeBehind="Results.aspx.vb" Inherits="If_Skade.Results" %>
Disabling request validation for your application
To disable request validation for your application, you must modify or create a Web.config file for your application and set the validateRequest attribute of the <pages /> section to false:
<configuration> <system.web> <pages validateRequest="false" /> </system.web> </configuration>
If you wish to disable request validation for all applications on your server, you can make this modification to your Machine.config file.
Caution: When request validation is disabled, content can be submitted to your application; it is the responsibility of the application developer to ensure that content is properly encoded or processed.
The code below is modified to turn off request validation: