Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get dynamic headers & Footers

How to get dynamic headers & Footers

Scheduled Pinned Locked Moved ASP.NET
csharphelptutorialasp-net
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aseef
    wrote on last edited by
    #1

    hi all, Am making a web application in asp.net and i have a problem...i.e How can i make dynmic headers and footers to my application using placeholder controls. I have got one example for this in this site itself from Mr.ajay,but its in c#. What i exactly need is how can i get the same in VB.Net. Plz....help me... waiting for all the early replys....... :^) Live Life King Size Asif

    T 1 Reply Last reply
    0
    • A aseef

      hi all, Am making a web application in asp.net and i have a problem...i.e How can i make dynmic headers and footers to my application using placeholder controls. I have got one example for this in this site itself from Mr.ajay,but its in c#. What i exactly need is how can i get the same in VB.Net. Plz....help me... waiting for all the early replys....... :^) Live Life King Size Asif

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      You can place contentplaceholders in your master but you will still need to use user controls. I used one for left and right sides of the page. Like this (in VB.Net). Dim UserCntrl As SideMenu UserCntrl = CType(LoadControl("UserControls/SideMenu.ascx"), SideMenu) If CStr(Session("MenuPos")) = "Left" Then Me.ContentPlaceHolderLeft.Controls.Add(UserCntrl) Else Me.ContentPlaceHolderRight.Controls.Add(UserCntrl) End If You can also access a placeholder from a content page. like this. Dim page As Page page = CType(Me.Parent.Page, Page) Dim pleft As ContentPlaceHolder pleft = CType(page.Master.FindControl("ContentPlaceHolderLeft"), ContentPlaceHolder) pleft.Controls.Clear() Dim pright As ContentPlaceHolder pright = CType(page.Master.FindControl("ContentPlaceHolderRight"), ContentPlaceHolder) pright.Controls.Clear() Dim UserCntrl As SideMenu UserCntrl = CType(LoadControl("SideMenu.ascx"), SideMenu) If Me.LinkButton3.Text = "Move Right" Then Web.HttpContext.Current.Session("MenuPos") = "Right" pright.Controls.Add(UserCntrl) End If If Me.LinkButton3.Text = "Move Left" Then Web.HttpContext.Current.Session("MenuPos") = "Left" pleft.Controls.Add(UserCntrl) End If "People who never make mistakes, never do anything." My Blog

      A 1 Reply Last reply
      0
      • T ToddHileHoffer

        You can place contentplaceholders in your master but you will still need to use user controls. I used one for left and right sides of the page. Like this (in VB.Net). Dim UserCntrl As SideMenu UserCntrl = CType(LoadControl("UserControls/SideMenu.ascx"), SideMenu) If CStr(Session("MenuPos")) = "Left" Then Me.ContentPlaceHolderLeft.Controls.Add(UserCntrl) Else Me.ContentPlaceHolderRight.Controls.Add(UserCntrl) End If You can also access a placeholder from a content page. like this. Dim page As Page page = CType(Me.Parent.Page, Page) Dim pleft As ContentPlaceHolder pleft = CType(page.Master.FindControl("ContentPlaceHolderLeft"), ContentPlaceHolder) pleft.Controls.Clear() Dim pright As ContentPlaceHolder pright = CType(page.Master.FindControl("ContentPlaceHolderRight"), ContentPlaceHolder) pright.Controls.Clear() Dim UserCntrl As SideMenu UserCntrl = CType(LoadControl("SideMenu.ascx"), SideMenu) If Me.LinkButton3.Text = "Move Right" Then Web.HttpContext.Current.Session("MenuPos") = "Right" pright.Controls.Add(UserCntrl) End If If Me.LinkButton3.Text = "Move Left" Then Web.HttpContext.Current.Session("MenuPos") = "Left" pleft.Controls.Add(UserCntrl) End If "People who never make mistakes, never do anything." My Blog

        A Offline
        A Offline
        aseef
        wrote on last edited by
        #3

        Thanks For ur valuable suggestion ill work on that and get back to you soon. Thanks once again:) Live Life King Size Asif

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups