Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...AJAX Slider Control in DNNAJAX Slider Control in DNN
Previous
 
Next
New Post
9/18/2007 5:34 AM
 

Hi,

Has anyone implemented this yet?

I have AJAX working fine in my DNN development and I'm aware of the two general approaches to using AJAX in a module:

1) Use the Partial rendering flag to [effectively] wrap the whole module in an update panel.

2) Use the 
"DotNetNuke.Framework.AJAX.IsInstalled Then DotNetNuke.Framework.AJAX.RegisterScriptManager()" construct + specifics to wrap particular controls in an update panel, etc...

I took a look at http://www.asp.net/learn/ajax-videos/video-121.aspx  to see how it was done in the 'standard' ASP.net world, but I've so far been unable to get this to work in DNN.

Symptoms are that the slider bar image doesn't render [ie missing image - no idea where that should be!] and no 'dragability' on the bar iteself.

 

Anyone any ideas?

Regards,
D.

 

 
New Post
11/16/2007 10:57 AM
 

I found the same problem.  The cause is something to do with the FriendlyUrls.  If you shut them off in the Host settings it fixes the problem... I would like to find a better solution to this problem however, this site really needs to have the friendly URLs turned on... but it's a start.  Probably something to do with the resources for the script are not expecting extra directories in the URL but rather relative to the application directory.

Does anyone out there know if its possible to in some way tell my AJAX control or my custom module to ignore the FriendlyURLs and use the absolute URL without having to change the setting for the whole DNN instance?

 
New Post
11/16/2007 2:25 PM
 

I can get the slider bar to properly drag and get/set values from an extended textbox by simply (in VS2005) dragging an AJAX Toolkit control from the VS2005 toolbox (after having added the tools from AJaxControlToolkit.dll) onto the source or design view and specifying a few properties - TargetControlID being the most important to associate the extender with the text box and EnableHandleAnimation="True" to enable smooth dragging of the slide bar handle. However there are at least two problems:

1. When the Orientation property of the slider is set to "Vertical", the handle does not slide with a mouse drag but jumps to the location on the bar where the left mouse button was released.

2. Only the top or left (depending on setting of Orientation property) portion of the slide bar handle draws itself. The images for the rails and handle are actually embedded resources in the AJAXControlToolkit.dll assembly. The default rail which displays properly is referenced as a background image URL in the rail's (a div element) CSS class. That class and the referenct to the embedded image work properly as the slider's embedded stylesheet link is being properly added to the page source as a reference to WebResource.axd in the root directory of the DNN website. The problem with the slide bar handle image is that the src attribute of its html image tag is being constructed (in the client script for the slider extender control) with an incorrect reference to WebResource.axd which looks something like (on my development box) http:/ /localhost/DNN4Dev/Test/tabid/45/ctl/mysettings/mid/93/WebResource.axd? . . . rather than http:/ /localhost/DNN4Dev/WebResource.axd? . . .

I'll take a look at the AJAX Control Tookkit script for the slider extender when I can to see where the problem arrises. It does appear that it is getting thrown off by DNN's friendly URLs.

I've recently been doing quite a bit of work with creating AJAX extender controls and server controls based on the AJAX Toolkits ExtenderControlBase and ScriptControlBase classes and in doing so have also been embedding images and css in my control's assembly without problems caused by DotNetNuke's friendly URLs so it shouldn't be too much of a problem to fix - it would, however, mea a recompile of AJAXControlToolkit.dll.  It also appears possible to specify the HandleURL as a property of the extender. Perhaps this would be the way to go for now.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
11/16/2007 11:20 PM
 

I looked through the AJAX Control Toolkit's SliderExtender.cs extender control and the SliderBehavior.js script.  The problem with rendering the proper src attribute value for the slider handle image stems from the following line in SliderBehavior.js:

var defaultHandleImageUrl = (this._isHorizontal) ? '< %= WebResource("AjaxControlToolkit.Slider.Images.slider_h_handle.gif") % >'
            : '< %= WebResource("AjaxControlToolkit.Slider.Images.slider_v_handle.gif") % >';

Because the images are embedded as resources in the AJAXControlToolkit.dll assembly and must be extracted via the WebResource.axd handler built into ASP.NET 2.0, the script WebResource is marked with the attribute PerformSubstitution="True" in SliderExtender.cs:

[assembly: System.Web.UI.WebResource("AjaxControlToolkit.Slider.SliderBehavior.js", "text/javascript", PerformSubstitution=true)]

Setting PerformSubstitution="True" causes tokens such as <%= WebResource ( . . .) %>in the script (which is also embedded as a resource in the AJAXControlToolkit.dll assembly) to be replaced with their resolved values when the extender behavior is initialized. Apparently this is done with a call to Page.ClientScript.GetResourceUrl somewhere in the AJAX framework. Unfortunately, with the URL re-writing that is taking place in DNN, the token is getting incorrectly resolved to a URL that looks something like:

http:/ /localhost/DNN4Dev/Test/tabid/45/ctl/mysettigs/mid/93/WebResource.axd? . . . rather than: http:/ /localhost/DNN4Dev/WebResource.axd? . . .

Because a similar substitution in the slider's style sheet slider.css or a direct call to Page.ClientScript.GetResourceUrl (SliderExtender1.GetType(), "AJAXControlToolkit.Slider.Images.slider_h_handle.gif") in a module control which includes a SliderExtenderControl is properly resolving, I suspect that when the token replacement in the embedded script is performed, the friendly url re-writing of DNN has already occured while similar replacement in slider.css or in the direct call to GetResourceUrl in the Page_Load of the module has not yet happened.

Rather than making a change to SliderBehavior.js and having to recompile the AJAXControlToolkit, I would suggest the following which seems to work for the horizontal slider:

1. Copy the handle images "slider_h_handle.gif" and "slider_v_handle.gif" from the AJAX Control Toolkit's source folder (AJAXControlToolkit\Slider\Images) to the images folder in your DNN website root.

2. Make use of the HandleImageUrl property of the slider extender to specify either of these image files (depending if the Orientation property is horizontal (default) or vertical). If this is done in the module control's .ascx the following will work:

< cc1:sliderextender id="SliderExtender1" runat="server" tooltiptext="{0}" handleimageurl="~/images/slider_h_handle.gif"
EnableHandleAnimation="True" Orientation="Horizontal" minimum="0" maximum="100"
behaviorid="Slider1" targetcontrolid="tbPageSize" >< /cc1:sliderextender >

Unfortunately, while this will correct the missing image for the vertical orientation as well as the horizontal, it does not correct the problem with the handle of a vertical slider not being draggable. Any attempt to mouse down on the handle immediately snaps it to the top of the slider. Mouse up then moves the handle to the the current mouse coordinates. Even in this case, the vertical slider correctly sets its initial position and returns its value to the textbox. I did not see any quick fix for this and would have to step through the behavior script to see what is happening.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
11/16/2007 11:49 PM
 

You might try moving the ScriptModule in the httpModules section of the web.config to either before or after (depending on where it is now) the UrlRewrite module to see if it makes a difference.  I'm not even sure if the ScriptModule handles the Ajax in question but it is worth a try.


DotNetNuke Modules from Snapsis.com
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...AJAX Slider Control in DNNAJAX Slider Control in DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out