ahhhhhh... wow, no that was my bad entirely. You said 'handle' handle is the right word, and I just was dense. Sorry.
Ok, getting the HANDLE is a touch harder, but not by much. If you want to affect the handle from the server (which I gather you do) then your best bet is to use the handleCssClass and handleImageUrl properties of the control.
What I'd suggest, just a quick thought on the fly (untested) is something like a dynamically generated css. You can do that one of two ways off the top of my head. First (easiest, least SEO-friendly) is to embed a small Style section in the page that has its contents generated by you. One way is to put a server-side style element in the <head> like so:
<head runat="server">
<title>Style page</title>
<style type="text/css" id='dynamic' runat="server"/>
</head>
You can then generate the contents of that style element in the code-file by setting its InnerText property; here's one way:
public partial class style_test_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
dynamic.InnerText = GetStyle();
}
private string GetStyle()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder(".dynamicHandle");
sb.Append("{");
sb.Append("background-repeat : repeat-x;");
sb.Append(String.Format("width : {0}px;",GetWidth().ToString()));
sb.Append("}");
return sb.ToString();
}
private int GetWidth()
{
return 200;
}
}
Another way to do all this that's somewhat more flexible is to create an ashx file that sets its content-type to text/css and outputs whatever you need. An example of that is here: http://cfouquet.blogspot.com/2006/06/making-dynamic-css-content-with-aspnet.html though he uses an aspx page insetad of a generic handler (go w/ the handler; it's got a lighter memory footprint on your server).
Hope this helps.
Paul
Help those who have helped you... remember to "Mark as Answered"