Monday, July 16, 2007

ASP.NET Control Styles

I feel like a complete idiot.  You CAN give ASP.NET controls element level style information.  E.G.:

<asp:Label ID="lbl" runat="server" Text="Hi" Style="border: solid 10px Blue;" />

I assumed this wasn't possible, and that you had to use asp.net skins or something, simply because "Style" doesn't come up on the intellisense for an ASP.NET control, and it does for a regular html control like <input type="button" /> ... etc. VS 2005 will even give you help with writing the style once you are in the double quotes after the Style attribute.  Sometimes I feel like instead of spending time with my family, or enjoying a good game, I should spend every moment of my life I'm not at work reading about stuff I use at work.  :-(  I guess I'll just keep looking at example source code and such to keep learning all these little nuances, tips, tricks, and design patterns.  I figured this one out while figuring .skin files out while looking over the StarterSite that comes with SubSonic.

Thursday, July 05, 2007

Wrapping a Flash SWF <object> with Hyperlink Anchor <a>

The quick answer to this problem (at least if you want browser compatibility): it is impossible - you must have any hyperlink you want your flash to link to to actually be in the flash file itself - that is, you have to make a button and have it be a link in the .FLA or .SWF file itself.  So, if this link has to be set at run-time, you'll need to make a special "Loader" flash file and have it have the transparent button in it.  That part of it is above me (for now).  Maybe I'll write about making one of those when I figure that out.

So, you should know that this does not work after doing a little Googling:

<a href="medium.aspx?id=25">
<object width="200" height="128" quality="Medium" loop="true" play="true"
data="media/static/1_25.swf" id="Flasher1" type="application/x-shockwave-flash"/>
</
a>

What also doesn't work is trying to make a <div>, setting it to position:fixed, and z-index: 10000.  Even if you make the <div>'s background-color transparent, you will no longer be able to see the Flash file (at least in Firefox you won't be able to).

Disqus for A Nofsinger's Blog