Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 7 of 7

Thread: adding user controls to xmlpackages

  1. #1
    mc9000 is offline Member
    Join Date
    Aug 2007
    Posts
    83

    Question adding user controls to xmlpackages

    What's the best (or preferred) way to add user controls to an XML package?
    I have a few I needed to put in, but not sure how to go about it (I know how to do this for typical asp.net pages, but the skinning engine has me a bit confused).

    Can someone point me in the right direction?

  2. #2
    mc9000 is offline Member
    Join Date
    Aug 2007
    Posts
    83

    Unhappy

    OK, figured out from looking elsewhere in these forums that ASPDotNetStorefront does not support controls at all in XML packages.

    I'll try putting the controls in the template.ascx.

  3. #3
    mc9000 is offline Member
    Join Date
    Aug 2007
    Posts
    83

    Question

    oops, that doesn't work either (for any control)!

    Anyone have any success with this?

  4. #4
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    what exactly are you trying to achieve - it can probaby be done in the xmlpackage directly.


    TTFN

    BFG

  5. #5
    mc9000 is offline Member
    Join Date
    Aug 2007
    Posts
    83

    Default

    Just trying to register a web control and be able to access it's properties to change on the fly. I have a vast (and quite expensive) collection of various controls that work on all sorts of sites including modal popups, gallery controls, etc.
    While I can register the control(s) on the template.ascx (control), they only work on the first call - subsequent calls wipe out the ability to reference them from the server side.

    For example: I have a modal popup control that has to be switched on from the server before the page is displayed. For example:

    Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
    Dim oDialog As OboutInc.Window.Dialog = DirectCast(Me.FindControl("myDialog"), OboutInc.Window.Dialog)
    If Not oDialog Is Nothing Then
    Dim hdn As HiddenField = DirectCast(Me.FindControl("whereami"), HiddenField)
    If Not hdn Is Nothing Then

    Select Case hdn.Value.ToString.ToLower
    Case "specialproductpage"
    Dim lbl As Label = DirectCast(oDialog.FindControl("lblDialog"), Label)
    lbl.Text = "Important notice! Please Read!"

    oDialog.VisibleOnLoad = True
    Case Else
    'more stuff here
    End Select
    End If

    End If

    MyBase.OnInit(e)
    End Sub


    That sub looks for a hidden field (hard coded in the specific product template),
    if it finds it, it sets a flag for the modal dialog window. When the page finishes loading, the modal dialog appears requiring the user to click [OK] before allowing access to the page. (ultimately, it will store a special cookie and another field in the customer table indicating that they clicked OK).

    The problem is that after the first time, the control still renders, but none of it's properties can be accessed using the FindControl method. This includes even simple controls like a literal or label (not just 3rd party stuff).

    I assumed that standard ASP.NET controls would be available to use in ASPDNSF (especially by version 8 since controls have been standard fare for ASP.Net since ver 1.1 in 2002). I understand there is no support for AJAX, but web controls?

  6. #6
    jgreywolf is offline Junior Member
    Join Date
    May 2010
    Posts
    14

    Default

    I have a question I would like to tack on to this thread. I had planned on using a couple of custom controls to manage some special functionality that client was looking for in their website - but given recent findings looks like this will not be possible (or at least not as easy as thought).

    What I am trying to do is to add functionality on product page to allow for additional images of product to be loaded underneath the main image, thumbnaill versions really, and when you click on one of those thumbnail images the main image will change to that one. And then if you click on one of the "swatches" for various color/fabric options the main image switches back to the default and then the color swatch functionality takes place.

    Think this can be done via packages?

    Justin

  7. #7
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    That should be doable, though probably with javascript rather than a control since you'll need to do it within the XML package.

    For the thumbnails, take a look at the 'UseImagesForMultiNav' AppConfig - bottom of this page.