locked
Submitting HTML Causes Error RRS feed

  • Question

  • User-1298853212 posted

    I've been testing DD with different fields and I have a table that I want to submit HTML content to. When I try to save I get the following error:

    Line:4698
    Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

    Is there any way around this? 

    Thursday, May 15, 2008 5:40 PM

Answers

  • User660823006 posted

    Craig,

     I noticed in your first screenshot you had put HTML into the textbox. By default if ValidateRequest is turned on which is a security mechanism to prevent things like script injectin attacks. If you put the PageDirective - ValidateRequest="false" in the page or page template it will turn this off and allow such input. Note you can also disable this across the website in web.config.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 15, 2008 7:30 PM

All replies

  • User-797310475 posted

    Could you provide some more information regarding this issue?

    • Enable debugging in your project and provide the full stack trace of the problem.
    • Are you using the default Dynamic Data project/control or are you using anything custom?
    • What kind of content were you submitting?
    • Could you create a small app that repros this problem?

    All this information would help us pinpoint what exactly is the problem.

    Thursday, May 15, 2008 6:51 PM
  • User-1298853212 posted

    Marcin:

    Thanks for your help.

    I have encountered this on a couple different databases. I created a test table earlier today to try and work with this error.

    I am not running anything custom - just the plain scaffolding from DD. This site was created as the standard DD site, not a Wizard site.

    Here is the create script for my table:

    CREATE TABLE [dbo].[Tst](
    	[TestId] [int] IDENTITY(1,1) NOT NULL,
    	[Text] [varchar](max) NULL,
     CONSTRAINT [PK_Tst] PRIMARY KEY CLUSTERED 
    (
    	[TestId] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    

    Here is a screen shot of the data I submitted and the resulting error message. I just tried to save "<h1>test</h1>" to the table.

    Here is a screen shot of code where the debugger stopped and the dialog the debugger displayed.

    If you need a copy of my project, direct message me an email address I can send it to. 

    If you need anything else, let me know.

    Thanks again for the help.

    Craig

    Thursday, May 15, 2008 7:20 PM
  • User-1298853212 posted

    Also... I have not installed SP1 yet, so I am running off the 4/23 build

    Craig 

    Thursday, May 15, 2008 7:28 PM
  • User660823006 posted

    Craig,

     I noticed in your first screenshot you had put HTML into the textbox. By default if ValidateRequest is turned on which is a security mechanism to prevent things like script injectin attacks. If you put the PageDirective - ValidateRequest="false" in the page or page template it will turn this off and allow such input. Note you can also disable this across the website in web.config.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 15, 2008 7:30 PM
  • User-1298853212 posted

    Thanks, Scott. I should have thought of that [:)]

    Thursday, May 15, 2008 7:56 PM
  • User-1254308814 posted

    I am aware of the CausesValidation flag and willing to put in the serverside validation to thwart that action yet setting those flags don't enable me to add html content into the insert fields. I need a way to insert and update html content. Anybody with any luck doing this?

    Wednesday, October 22, 2008 12:11 AM
  • User-1298853212 posted

    jwize:

    You need to make sure you add ValidateRequest="false" to the Insert.aspx and Edit.aspx page templates.

    Craig

    Wednesday, October 22, 2008 10:24 AM