v4: not possible to set ValidateRequest to false Options
daniel
Posted: Wednesday, August 20, 2008 2:39:50 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
Looks like the new liveEditing feature breaks the possibilities to have forms with html posted back on the frontend.

As for what I can trace (using Reflector) toggling the liveEditing feature is the only way to post html content now.. but this again is not an option for public users.. ;)

Anyone?
hartvig
Posted: Thursday, August 21, 2008 7:21:04 AM

Rank: Addict

Joined: 3/17/2008
Posts: 982
Location: Nyborg, Denmark
there's a public property on the default.aspx page that you can programmatically set. Can't remember it ATM but it should be pretty obvious. So in a user control cast the Page object to the type of the umbraco default.aspx and you can set it to false programmatically which I'd much better as you only turn off validation when you need it :-)

Jeeeez, did I really start this :-)
daniel
Posted: Thursday, August 21, 2008 1:07:29 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
Thanks, testet that but no go.

Umbraco somehow triggers PageLoad in default.aspx before the UserControls (macro) Init method - so, ValidateRequest is set to false too late. Umbraco have already triggered ASP.NETs ValidateRequest.. d'oh!
daniel
Posted: Thursday, August 21, 2008 1:48:20 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
To test, I've created a new Macro with a UserControl that's placed all the way on top in the master template

The UserControl has only one thing in it:

Code:

        protected void Page_Init(object sender, EventArgs e)
        {
            ((umbraco.UmbracoDefault)this.Page).ValidateRequest = false;

        }


Attached two breakpoints - one on Init in the UserControl and one in UmbracoDefault (/default.aspx) on Page_Load


Code:

        protected void Page_Load(object sender, EventArgs e) {

            if (ValidateRequest)
                Request.ValidateInput();
   ...



I'm attaching the debugger to the asp.net process and load the page.. the page_load event on the page triggers before the page_init on the UserControl - making it impossible to set the ValidateRequest to false before umbraco uses the variable and triggers ASP.NETs request validation..
hartvig
Posted: Thursday, August 21, 2008 7:58:33 PM

Rank: Addict

Joined: 3/17/2008
Posts: 982
Location: Nyborg, Denmark
Bugger - thanks for bringing this up! Could you add it as an issue in the tracker...

Jeeeez, did I really start this :-)
daniel
Posted: Thursday, August 21, 2008 9:40:05 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
hartvig
Posted: Wednesday, December 17, 2008 3:52:39 PM

Rank: Addict

Joined: 3/17/2008
Posts: 982
Location: Nyborg, Denmark
Just tried to reproduce and it worked fine and as expected. No bugs and validation is turned off :)

Jeeeez, did I really start this :-)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.