ASP.NET
Re: Initialize Scriptvariables
11/17/2008
11:49:24 AM
2II0PCDBF Show this entire thread in new window
From:
Rick Strahl
To:
Peter Bollinger
Attachments:
None

Yes the library is pretty much already available here as part of sessions I've been doing but I haven't created all the documentation and packaging properly at this time. Basically it's been reworked to work with jQuery to perform much of the heavy lifting on the client, but retains basically the same model as before with AjaxMethodCallback, DragPanel, HoverPanel and ModalDialog controls in place as before plus a whole slew of jQuery plug-ins to support all of this functionality...

I just posted my slides and samples from DevConnection here:
http://www.west-wind.com/weblog/posts/543251.aspx

which contains this stuff or you can grab this stuff from Subversion here:
http://www.west-wind.com:8080/svn/jQuery/trunk/jQueryControls/Support/

Preliminary docs are here:
http://www.west-wind.com/tools/westwindajaxtoolkit/docs/?page=_2hh0s4zli.htm

This is pretty much the final layout although the assembly will likely change. Hopefully in the next few weeks I'll be able to get this packaged and released properly, but for now all the functinoality is there...

+++ Rick ---


Rick,

Thank you for the time you spend to my problem.
I found that the permission in my web.config is in deed set to full trust - so this pointing more to the property value 'IsAdmin' you detected. Since this seems to be part of the Westwind.Ajax.Toolkit.dll my question is obviously if you plan to modify this library?

Aloha, Peter


I was intending for:

<trust level="Full" />

in web.config to ensure that the control's properties can be accessed with reflection. But that actually works as long as you're talking to the page and you have a this reference to it in which case protected reflection works.

But it turns out there's a bug in the code. Specifically for some reason I can't quite figure out, there's a hardcoded value of "IsAdmin" instead of the actually property value used in ScriptVariables.RenderClientScript:

// *** It's a dynamic key string[] tokens = entry.Key.Split(new char[1] { '.' }, StringSplitOptions.RemoveEmptyEntries); string varName = tokens[0]; string property = tokens[1]; object propertyValue = null; if (entry.Value != null) propertyValue = ReflectionUtils.GetPropertyEx(entry.Value, "IsAdmin");

It should be:

// *** It's a dynamic key string[] tokens = entry.Key.Split(new char[1] { '.' }, StringSplitOptions.RemoveEmptyEntries); string varName = tokens[0]; string property = tokens[1]; object propertyValue = null; if (entry.Value != null) propertyValue = ReflectionUtils.GetPropertyEx(entry.Value, property);

Not sure how this happened (looks like some sort of accidental replace occurred).

This should fix the problem.

+++ Rick ---






Rick Strahl
West Wind Technologies

Where do you want to surf today?
Reader Version: 5.0

from Maui, Hawaii