Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Two question about ASP.NET Custom Controls [Newbie]

Reply
Thread Tools

Two question about ASP.NET Custom Controls [Newbie]

 
 
DaBrain
Guest
Posts: n/a
 
      10-27-2006
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?

 
Reply With Quote
 
 
 
 
Michael Hamrah
Guest
Posts: n/a
 
      10-29-2006
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; }
}

DaBrain wrote:
> 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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
Custom Controls: Import a custom namespace and use its functions within user ASP .Net 1 07-19-2007 11:03 AM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
Custom Control : One custom property to array of controls anon ASP .Net Web Controls 0 01-15-2005 11:32 AM
Custom controls instance problem on PostBack - two controls, one instance ??? Dejan Vesic ASP .Net Web Controls 0 08-20-2003 02:43 PM



Advertisments