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. ContentPlaceHolder Masterpage Issue

ContentPlaceHolder Masterpage Issue

Scheduled Pinned Locked Moved ASP.NET
helpdatabase
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.
  • T Offline
    T Offline
    twinscythe12332
    wrote on last edited by
    #1

    Hi, I have a ContentPlaceHolder that is in a masterpage. I have a drop down in my masterpage, and this I am using to try and change certain details in the page(contentplaceholder). My issue is that when the dropdown's selected index event causes the postback (event in master page), it goes into the placeholder code first, before moving out into the masterpage, which seems highly incorrect to me 0_o. any help on this would be greatly appreciated.

    T 1 Reply Last reply
    0
    • T twinscythe12332

      Hi, I have a ContentPlaceHolder that is in a masterpage. I have a drop down in my masterpage, and this I am using to try and change certain details in the page(contentplaceholder). My issue is that when the dropdown's selected index event causes the postback (event in master page), it goes into the placeholder code first, before moving out into the masterpage, which seems highly incorrect to me 0_o. any help on this would be greatly appreciated.

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

      My sugesstion is to put the code in the content page (since you are trying to change the content page) and add a handler for the dropdownlist's event in the content page. protected void Page_Init(object sender, EventArgs e) { DropDownList ddl = (DropDownList)this.Master.FindControl("DropDownList1"); ddl.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIndexChanged); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { //Put code here }

      I didn't get any requirements for the signature

      T 1 Reply Last reply
      0
      • T ToddHileHoffer

        My sugesstion is to put the code in the content page (since you are trying to change the content page) and add a handler for the dropdownlist's event in the content page. protected void Page_Init(object sender, EventArgs e) { DropDownList ddl = (DropDownList)this.Master.FindControl("DropDownList1"); ddl.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIndexChanged); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { //Put code here }

        I didn't get any requirements for the signature

        T Offline
        T Offline
        twinscythe12332
        wrote on last edited by
        #3

        thank you very much it works hundreds ^^. I've also used an AJAX Update Panel that effectively Fires the event first, then carries on. I'm wondering which would perform better though =/. curse my curiousity.

        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