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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AjaxToolkit SlideShow extenderAjaxToolkit SlideShow extender
Previous
 
Next
New Post
9/11/2008 11:19 AM
 

I am probably gonna cross post this a lot ... sorry but I think I have found where it doesn't work in DotNetNuke but does work in Visual Studio.

In the AjaxControlToolkit ExtenderControlBase, there is a render method which when called, calls it's base.render which in turn allows you to step through ACT's ExtenderControl render, which call's it's base.render. When this is called from within a web application project (www.codeplex.com/dropthings) this render calls the System.Web.UI.Extender.Render method, which I don't have source code.

Somewhere in this render method, the ScriptControlBase.GetScriptDescriptors method is called (which is in non user code, can't step through this!) which eventually calls the ExtenderControlBase.GetScriptDescriptors method which iterates through the class (in your case SlideshowExtender) in my case a custom control in the DropThings project called CustomDragDropExtender which has designer properties for setting attributes in designer or tag on web form. In any event, these properties are only iterated through after the render method is called, and the result of the iteration is to create a script which initializes the script resources used by the ExtenderControl ...

Hope I got all that right. The key is... when I hit the render method in the Dropthings Web Application Project, the next user code method to be called is the GetScriptDescriptors and all the other code which builds the script which initializes the control (in scriptresource.axd?xsdfs)... Again, this same method, when hit in DNN, does NOTHING.

Anyone get any further with this? I am also gonna post on ACT forums if I can find a relevant place to post... if I can't get this working it's gonna make me eat like 30 hours of development time!

 
New Post
9/17/2008 4:04 PM
 

Well, at least I didn't cross post that. I did find the answer to my problem, figured I'd post it for the hapless misadventurers who stumble across my path. Following was also posted to the www.codeplex.com/dropthings discussions board.

I eventually resolved this... as it turns out the point in the page life cycle (Page_Render) where the control is loaded it is not yet in the 'control tree'.

The register client scripts code checks to see if the control is loaded into the page's control tree and if it isn't won't register the client script initialization stuff...

The work around I found was to manually create a new instance of the Script Manager class and manually call "RegisterScriptDescriptors" in WidgetPanels.ascx.cs:

protected void Page_PreRender(object sender, EventArgs e)
{
    Page page = Page;
    System.Web.UI.
ScriptManager _scriptManager = System.Web.UI.ScriptManager.GetCurrent(page);
    _scriptManager.RegisterExtenderControl(
this.CustomDragDropExtender1, this.LeftPanel);
    _scriptManager.RegisterExtenderControl(
this.CustomDragDropExtender2, this.MiddlePanel);
    _scriptManager.RegisterExtenderControl(
this.CustomDragDropExtender3, this.RightPanel);
    _scriptManager.RegisterScriptDescriptors(
this.CustomDragDropExtender1);
    _scriptManager.RegisterScriptDescriptors(
this.CustomDragDropExtender2);
    _scriptManager.RegisterScriptDescriptors(
this.CustomDragDropExtender3);
}

 

 
New Post
1/6/2009 3:32 AM
 

 

I tried working with context key for slideshowextender and got positive results. Most of the posts on web for this topic put emphasis on using inline webservice. But my code works with webservice added as an item of project.
 
Important points for proper functioning of code:
 
  • Use “contextKey” property of slideshowextender for making call to parameterized method of webservice. Set UseContextKey="true" in slideshowextender. Also assign initial value for webmethod parameter in ContextKey e.g. ContextKey="Images". Later on you can pass parameter value in code behind(.aspx) depending on special conditions.
 
  • Word “contextKey” in signature of webservice method is case sensitive.
“Public Function GetPhotos(ByVal contextKey As String)”
 
Mind it, minor change in case change can give you an error on webpage. So make sure that all letters except “K” in contextKey should be in lower case.  
 
 
 
**Code for.asmx file(webservice)
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
 
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class slideservice
    Inherits System.Web.Services.WebService
 
    <WebMethod()> _
    Public Function GetPhotos(ByVal contextKey As String) As AjaxControlToolkit.Slide()
 
        Dim dir1 As New IO.DirectoryInfo(contextKey)
        Dim ofiles = From file In dir1.GetFiles("*.jpg") Order By file.Name Select file
        Dim ojaxslide(ofiles.Count - 1) As AjaxControlToolkit.Slide
        If ofiles.Count = 0 Then Exit Function
        Dim i As Integer
        i = 0
        For Each file In ofiles
            ojaxslide(i) = New AjaxControlToolkit.Slide(IO.Path.GetFileName(contextKey) & "/" & file.Name, file.Name, IO.Path.GetFileNameWithoutExtension(file.Name))
 
            i += 1
        Next
        Return ojaxslide
    End Function
 
 
End Class
 
***code Behind
 
Partial Public Class photos
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Select Case Request.QueryString.Get("path")
 
            Case "Temple"
                SlideShowExtender1.ContextKey = Server.MapPath("Images")
            Case "History"
                SlideShowExtender1.ContextKey = Server.MapPath("Temple History")
        End Select
 
    End Sub
 
End Class
 
 
 
 
 
****Code for .aspx
 
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Login.Master" CodeBehind="photos.aspx.vb" Inherits="SelfPractice_project.photos" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
 
<div style="text-align:center">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:Image ID="Image1" runat="server" BorderColor="Black" BorderStyle="Solid"
        BorderWidth="2px" ImageUrl="~/Icon/HomePage.jpg" Height="300px" />
        <br/>
        <asp:Label ID="imageLabel1" runat="server" Font-Bold="True"
        ForeColor="Black" Font-Size="Medium" ></asp:Label>
        <h1 />
    <asp:ImageButton ID="Prev" runat="server"
        ImageUrl="~/Icon/Button Previous.Jpg" />
    <asp:ImageButton ID="Play" runat="server" ImageUrl="~/Icon/Button Pause.Jpg" />
    <asp:ImageButton ID="Next" runat="server"
        ImageUrl="~/Icon/Button Next.Jpg" />
 <cc1:SlideShowExtender ID="SlideShowExtender1" runat="server"
                TargetControlID="Image1"
                 SlideShowServicePath="slideservice.asmx"
                 SlideShowServiceMethod="GetPhotos"
                 ContextKey="Images"
                 UseContextKey="true"
                 AutoPlay="true"
                NextButtonID="Next"
                PlayButtonText=""
                StopButtonText=""
                PreviousButtonID="Prev"
                
                PlayButtonID="Play" Loop="true"
                ImageDescriptionLabelID="imageLabel1"/>
 
</div>
</asp:Content>
 
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AjaxToolkit SlideShow extenderAjaxToolkit SlideShow extender


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