1) I am developing custom controls and was wondering how I can
implement the URL ~ deal.
~/page/page.aspx
How do I translate ~ to the web root? I must be overlooking something
very simple here?
2) How do have something like this
<aaa:control runat="server">STUFF HERE</aaa:control>
How do I programmatically get "STUFF HERE", Where does it show at?
Is it accessable?
Michael Hamrah - 29 Oct 2006 19:58 GMT
1) You can use the Page.ResolveClientUrl() property to properly parse
the ~ character. The ~ essentially deails with virtual directories
correctly.
2) This can be done via the parsechildren attribute.
Lets say you have a WebControl Demo with a property Text. To map the
Inner Html of the markup to the text property you would specify:
[ParseChildren(True, "Text")]
public class Demo
{
public string Text
{get; set; }
}
> 1) I am developing custom controls and was wondering how I can
> implement the URL ~ deal.
[quoted text clipped - 10 lines]
>
> Is it accessable?