Server Controls in header file

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

  1. #1

    Default Server Controls in header file

    Hi,

    I have files called header.ascx and footer.ascx which are included in pages
    by a class that inherits System.Web.UI.Page and overides OnInit. See:
    -------------------------
    Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

    Me.Controls.AddAt(0, LoadControl("../header.ascx"))
    MyBase.OnInit(e)
    Me.Controls.Add(LoadControl("../footer.ascx"))

    End Sub
    --------------------------

    I would like have a DropDownList server control (amongst others) in my
    header. How can I achieve this. I am having problems with multiple form
    tags and such like.

    All help is much appreciated, if you need any more info please ask, thanks
    in advance,

    Marcus Robinson

    The Programming Pages - [url]http://www.programmingpages.com[/url]
    Mr ICT Web Hosting - [url]http://www.mrict.co.uk[/url]


    Marcus Robinson Guest

  2. Similar Questions and Discussions

    1. using javascript in User controls to access server controls of the user control
      Hello all, I have an asp.net textbox (named txtHidden) and an HtmlButton(named btnAction). I wanted to write a javascript function which will get...
    2. Server did not recognize value of HTTP Header SOAPAction
      When creating my web service I set the namespace to test. Now that I have completed the service I have changed the namespace to...
    3. composite controls... Microsoft Press: Dev ASP.NET Server Controls
      I have the Microsoft Press: Developing Microsoft ASP.NET Server Controls and Components book. It's starting to shine some light on control...
    4. Header Controls
      Hi All, Can someone help me with what I believe could be a simple answer. I've created a datagrid, of which I have a template column containing...
    5. how to check controls that on datagrid header
      Anyone know why when I loop thru my datagrid item list I don't see my header or footer? I only see the item and alternatingitem types. The footer...
  3. #2

    Default Re: Server Controls in header file

    Marcus,

    You should never put form tags into a .ascx control. The only form tags
    should be on the .aspx page itself. Then when you drop your control onto the
    form it get's included inside of the .aspx page's form.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Marcus Robinson" <mDeErL1E0T8E@york.ac.uk> wrote in message
    news:3f3683fb$0$18497$cc9e4d1f@news.dial.pipex.com ...
    > Hi,
    >
    > I have files called header.ascx and footer.ascx which are included in
    pages
    > by a class that inherits System.Web.UI.Page and overides OnInit. See:
    > -------------------------
    > Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
    >
    > Me.Controls.AddAt(0, LoadControl("../header.ascx"))
    > MyBase.OnInit(e)
    > Me.Controls.Add(LoadControl("../footer.ascx"))
    >
    > End Sub
    > --------------------------
    >
    > I would like have a DropDownList server control (amongst others) in my
    > header. How can I achieve this. I am having problems with multiple form
    > tags and such like.
    >
    > All help is much appreciated, if you need any more info please ask, thanks
    > in advance,
    >
    > Marcus Robinson
    >
    > The Programming Pages - [url]http://www.programmingpages.com[/url]
    > Mr ICT Web Hosting - [url]http://www.mrict.co.uk[/url]
    >
    >

    S. Justin Gengo 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