C
crazyhorse
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;
}
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;
}