Custom Web Controls

R

Robert Warnestam

{This message was original posted in
microsoft.public.dotnet.framework.aspnet.buildingcontrols but was somehow
not delivered}


Hi,

I've problems with a custom WebControl. The control has properties for
letting the user set the relative path to some images and a xml file that
the controls need. In runtime the images are displayed and the control can
load the xml file. In design time however, this fails because the current
path in Windows depends on previous actions. The solution would be to use
MapPath, but in design time this cant be done.

// FileName is the path to be used when loading xml file or displaying
images
// UserFile is the relaitve path that is a property of the control

if (Context == null ) {
// We are in design time - I don't know what to do here
FileName = UserFile // ??????????????
} else {
FileName = HttpContext.Current.Server.MapPath( UserFile )
}




Any help would be much appreciated.

Robert Warnestam
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top