Rendering an UserControl inside a mail body without any page object reference

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

  1. #1

    Default Rendering an UserControl inside a mail body without any page object reference

    Hi
    I would like to use a User Control to render the body of the mail I send.
    I know how to do that using Page.LoadControl
    The problem is that my application is not an ASP.NET page so I can't use any
    Page object reference to call LoadControl
    What should I do ?
    Thanks

    Henri




    Henri Guest

  2. Similar Questions and Discussions

    1. Can we use a usercontrol inside a usercontrol
      hi group can we use a usercontrol inside a usercontrol. i mean can we use <%Register tagprefix..... src=....ascx%> in an ascx file. thanks in...
    2. Event not firing in usercontrol inside usercontrol
      I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these...
    3. Rendering design-time content on a web UserControl
      I created a web user control and would like to add the ability for it to contain design-time rendering capabilities. So that, during development,...
    4. Rendering on to Page object
      Hi all, I have written a server-side component that renders some charts as images. I want to give the charting classes (Pie, Bar etc.) the...
    5. How to reference UserControl in server code
      I can't seem to figure out how to get a reference to a UserControl in the code-behind for the page that contains the control. All the examples I've...
  3. #2

    Default Re: Rendering an UserControl inside a mail body without any page object reference

    Henri wrote:
    > Hi
    > I would like to use a User Control to render the body of the mail I
    > send.
    > I know how to do that using Page.LoadControl
    > The problem is that my application is not an ASP.NET page so I can't
    > use any Page object reference to call LoadControl
    > What should I do ?
    > Thanks
    >
    > Henri
    Give the user control a class name. You can do that in the control directive
    (in the ascx file):
    <%@ Control Language="VB" Class="myUserControl" %>

    Then, in the page that sends the mail, register the user control.
    You can do that by adding the control to your page once, and then removing
    it again.
    This will add the register directive to the page.

    Then you can use this line instead of Page.LoadControl (VB.NET):

    Dim myControl1 As New myUserControl()

    --

    Edge


    Edge 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