Showing posts with label webresource. Show all posts
Showing posts with label webresource. Show all posts

Saturday, March 24, 2012

Wizard Control, UpdatePanel, and Validation causes error in webresource.axd Bug

I have a wizard control with several steps, some of which use control validation. When placed inside an Ajax UpdatePanel, the webresource.axd javascript is no longer able to reference the controls validated in the previous step, and halts on:

WebResource.axdfunction ValidatorGetValue(id) { var control; control = document.getElementById(id); if (typeof(control.value) == "string") { return control.value; } return ValidatorGetValueRecursive(control);}

where the document.getElementById(id); returns null.

A workaround is to disable clientside validation on all validation controls, which is not a great loss when using ajax, but utterly annoying when you have gone to all the trouble of writing javascript for custom validation controls, etc.

The cause is probably complex, so I shall not comment on how it should be resolved. I assume, however, that the javascript is correct in that the controls not being rendered are in fact to be found in the DOM.

At least in my case, it would be nice if the javascript checked for null and ignored the control if it wasn't there.

Anyhow, it would be much appreciated if someone would look into it.

Thanks

In Atlas 1.0 we have updated versions of the validators that are compatible with UpdatePanel. In the current CTP I'm afraid that you'll have to use some workaround.

Thanks,

Eilon


This sounds like it could be related to my problem:

http://forums.asp.net/thread/1412888.aspx

What work arounds are available for this issue? At the moment I'm displaying all the controls in divs and just hiding them, which is pretty horrible.

Thanks,

Paul

Wednesday, March 21, 2012

Writing New Control - WebResource Url Throwing Exception

Hey Everyone,

I'm having a really hard time with this one. I recently upgraded to lateest control toolkit, and now i can't use my custom controls. I get the dreaded unrecognized tag error.

When I try to load the webresource.axd url for the javascript, I'm getting the following error:

WebResource.axd?d=_IYF6c389WdEZP8BREten0VCyRTYFXUFn9GR9MRXP-aoOJ5cYUZwsxAz4rdBOPaz6CoHQyUbH48-Kn0gv5WhhCj2yI8nUNAt-hz-wRrJAwI76fBROssmxDJplsNW85vw0&t=632907313964152042

Specified argument was out of the range of valid values.
Parameter name: offset

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset]
System.Web.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) +3153595
Microsoft.Web.Services.WebResourceCompressionModule.OnPreRequestHandlerExecute(Object sender, EventArgs e) +1103
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


any ideas?For some reason, the Atlas Control Extender template doesn't make the Behavior.js an embedded resource. Change that in the properties pane and rebuild.
yeah, i saw that in the FAQ, and made sure (and double sure) that it was marked as an embedded resource. and it looks like it is, because i am seeing the resource in the source. it's when the browser tries to read the resource that .NET is throwing that funky WebResourceCompressionModule error...
So using a tool like Fiddler, the js file is being sent across?? Hmmm.
I actually saw this yesterday when I was doing some work but (unfortunately) I didn't ever figure it out, mostly because it kind of magically went a way. I think I rebuilt everything clean and it started working.