Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / October 2006

Tip: Looking for answers? Try searching our database.

Two question about ASP.NET Custom Controls [Newbie]

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DaBrain - 28 Oct 2006 00:49 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.