MapPath cannot because it exists when there is a HttpContext alive (which
isn't the case in design mode) but you can use HttpUtility class during
design mode.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"crazyhorse" <> wrote in message
news: oups.com...
> can get the Server.MapPath to work in run-mode, but not in the property
> desinger window. It will throw an error. Try to read a xml file in
> the Oninit. Works when you run a web page, but not while you open the
> desinger properties window. What am i doing wrong, or is this is just
> the way a control works. How can i initialize my property from a xml
> file, without being in run mode.
>
>
>
> protected override void OnInit(EventArgs e)
> {
> base.OnInit(e);
> string ss="";
> try
> {
> ss=this.Context.Server.MapPath("myxmlfile.xml");
>
>
> }
> catch
> {
>
> }
> text2=ss;
> }
>