Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: CategoryList in a DropDownList?

  1. #11
    Join Date
    Jun 2009
    Posts
    191

    Default

    Quote Originally Posted by BFG 9000 View Post
    Ahh OK - you'd need to use some javascript on the 'onchange' event for the dropdown.

    A quick look on google gave me this & this.




    TTFN

    BFG
    I'm trying here, but I am having a hard time...

  2. #12
    Join Date
    Jun 2009
    Posts
    191

    Default

    I tried this, but it doesn't work. I think because it is a dropdown and not a regular hyperlink...

    Code:
    			<xsl:template name="DepartmentDropDown">
    				<select>
    					<option value="Select">View All</option>
    					<xsl:for-each select="/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[ParentEntityID=/root/Runtime/EntityID]">
    						<xsl:variable name="scName" select="aspdnsf:GetMLValue(Name)"></xsl:variable>
    						<option value="{aspdnsf:EntityLink(EntityID, SEName, $EntityName, 0, '')}">
    							<a href="{aspdnsf:EntityLink(EntityID, SEName, $EntityName, 0, '')}">
    								<xsl:value-of select="$scName" disable-output-escaping="yes"/>
    							</a>
    						</option>
    					</xsl:for-each>
    				</select>
    			</xsl:template>

  3. #13
    Join Date
    Jun 2009
    Posts
    191

    Default Anyone?

    Does anyone know how to add the link to each dropdown item dynamically? Sorry... but I am not very familiar with this at all.

  4. #14
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    873

    Default

    Sorry Mate - I have been (& still am) ill in bed.

    The second article I linked to has it all for you...

    I haven't tested it - but this should work :-


    C#/VB.NET Code:
                <xsl:template name="BFG-DropDown"
    <
    form name="jump1">
    <
    select name="myjumpbox"
     
    OnChange="location.href=jump1.myjumpbox.options[selectedIndex].value">
    <
    option value="Select">Select One</option
                    <
    xsl:for-each select="/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[ParentEntityID=/root/Runtime/EntityID]">
    <
    xsl:variable name="scName" select="aspdnsf:GetMLValue(Name)"></xsl:variable
    <
    option value="{aspdnsf:EntityLink(EntityID, SEName, $EntityName, 0, '')}"><xsl:value-of select="$scNamedisable-output-escaping="yes"/></option
                    </
    xsl:for-each
    </
    select>
    </
    form>
                </
    xsl:template


    TTFN

    BFG

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •