Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Thursday, March 29, 2012

Seperator between two specific menu items in asp:menu which uses a Sitemap

Let's say I have a sitemap like below. I use this in an asp:Menu and I ONLY want a seperator between link 2 and link 3.  How would I go about achieveing this. 
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url ="~/Default.aspx" title="Home" description="Home"> <siteMapNode url ="~/Default1.aspx" title="link1" description="link1" /> <siteMapNode url ="~/Default2.aspx" title="link2" description="link2" /> <siteMapNode url ="~/Default3.aspx" title="link3" description="link3" /> </siteMapNode></siteMap>
Thanks

you dont... you'll have to either do this in the render event or page load event, by trying to dynamically insert some node or such.

If you are going to use the sitemap and bound technique you will be limited on what you can do.


I guess I'm kind of out of lucky with this approach then huh.

The only flaky solution I have seen so far is inserting another sitemapNode like so with an hr tag in it.

<siteMapNodeurl =""roles="*"

title="<hr style='color:grey;height:1px;font-size:1px' />"

description="" />


yup... that was my other suggestion, but that can really mess up links, etc...very kludge like


Ok I followed your other advice and added anSeparatorImageUrl to the specific node at runtime in the MenuItemDataBound Event. It's not perfect, but it's the best solution so far. In fact maybe it doesn't get better :).

Thanks.


Now the last issue I have with this solution is that the menu will expand to the size of the image used. Is there a way to make the image stretch to the size of the menu?

Thursday, March 22, 2012

Serve SWF files from ASPX

Hello,

I would like to be able to allow people to link to videos on my site in the following manner (embed in their own websites):

<OBJECT CLASSID="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,22,0" ID="FVS" Width="720" Height="526">
<PARAM NAME="movie" VALUE="http://www.example.com/video.aspx?cid=123456">
<PARAM NAME="bgcolor" VALUE="#000000">
<EMBED NAME="FVS" src=http://www.example.com/video.aspx?cid=123456 BGCOLOR="#000000"
WIDTH="720" HEIGHT="526" TYPE="application/x-shockwave-flash" pluginspage=http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>

What I would like to do is have video.aspx choose avideo at random and serve to this particular customer ID ('videos' are all swf files). Forsimplicity's sake let's assume that I have 1000 SWF files all called1000.swf, 1001.swf etc. in the same directory as video.aspx. Is itpossible to code the page in a way that would allow me to do that? Ifso, how could I go about it, I have absolutely not idea. I can write the logic for selecting a random file, I just don't know how, once its selected, do I serve it to the end user. Any helpwould be appreciated.

M.

Hi,

You may take all files name of the directory in a arraylist. Then chose a filename from this arraylist using a random value.

and show it.


for some strange reason wherever I post this question (I did that on multiple forums) I always get the same response with suggestions how to choose a random file. I don't have a problem with that. I have a problem with the "and show it" part - I don't know how to make my object (see original code) to think that instead of aspx file I'm serving a SWF file.

I've been reading up about HttpHandlers and such, but there's got to be an easier way to do this without having to resort to configuring IIS and registering the handlers.