Asp – Xml data in an ASP.Net Dynamic Data Site

asp.netdynamic-dataxml

I have this problem where I can't get my dynamic data web app to save xml data into a text field. Maybe this is a common problem but searching the web doesn't give me any answers…

So heres the steps to recreate my problem:

  • I have database with a table that has a column of type "ntext" (Sql Server 2005).
  • I create a new Dynamic Data Entities Web Application, within this I create an ADO Entity Data Model and add the table with the ntext column.
  • I setup the global.ascx file and fire up the web app.
  • When the web app opens I navigate to the table and insert a new item
  • In the text box thats generated and represents the ntext column, i insert some xml (simple cut and paste from Notepad) and hit the Insert/Save button.
  • The insert fails with a the error:

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

Example of xml attempted

<?xml version="1.0" encoding="utf-8"?>
<root>
<item></item>
</root>

Typing a string of characters eg "hello world" works!

Can anyone help and tell me where I'm going wrong?

Thanks

Best Answer

It is probably becuase it sees what you are adding in a potential dangerous request. I would assume you have ValidateRequest="true" in the page directive. Is this correct?