Using images from skinfile in a composite control

A

Anton

Hi,

I have made a composite control with in it the Ajax
CollapsiblePanelExtender.
If i use the CollapsiblePanelExtender on its own i can use a skinfile
to set both the CollapsedImage and the ExpandedImage.
In my composite control however the image cannot be found. The problem
is probably in the way i pass the information from mycontrol to the
CollapsiblePanelExtender control.

Below some code:
Skin File:
<cc1:MyControl runat="server"
CollapsedImage="Images/Panels/expand.jpg"
ExpandedImage="Images/Panels/collapse.jpg" />

MyControl.cs:
..
..
public virtual string ExpandedImage
{
get
{
string s = (string)ViewState["ExpandedImage"];
return (s == null) ? String.Empty : s;
}
set {ViewState["ExpandedImage"] = value;}
}
// CollapsedImage is the same
..
..
protected override void CreateChildControls()
{
..
..
extender = new CollapsiblePanelExtender();
extender.ExpandedImage = ExpandedImage;
extender.CollapsedImage = CollapsedImage;
..
..
}

The result is that the image src is set to the relative path of the
current aspx page.
Anyone can help me with this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top