Two question about ASP.NET Custom Controls [Newbie]

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Two question about ASP.NET Custom Controls [Newbie]

    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?

    DaBrain Guest

  2. Similar Questions and Discussions

    1. newbie question on Custom Controls in C#
      I have just started working on an ASP.Net 1.0 project as my first forray into ASP.Net (or ASP for that matter), and have a general question about...
    2. Why the properties of web user controls which inherted from my custom base UI controls MISSED?
      Why the properties of web user controls which inherted from my custom base UI controls MISSED? How should I to set enable?
    3. General Question about custom controls
      In a windows application you use the Method() as an entry point for an application. In a web application using ASP.NET you use Page_Load() as an...
    4. Question about Custom Controls
      Dear all I'm building a web application that some standard controls in many pages as "DropDownlist" this drop down list is filled from a table in a...
    5. Newbie Web Service Question regarding User Controls
      Can I return a user control from a Web Service? I have a Web Page that has a Placeholder on it and I wish to populate this placeholder with a...
  3. #2

    Default Re: Two question about ASP.NET Custom Controls [Newbie]

    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?
    Michael Hamrah Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139