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. Controlling page elements from a .config file

Controlling page elements from a .config file

Scheduled Pinned Locked Moved ASP.NET
tutorial
2 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.
  • C Offline
    C Offline
    Cyberpulse
    wrote on last edited by
    #1

    Is there a way to create a config file that controls the elements on specific pages. For example I have 2 pages viz. page1.aspx and page2.aspx. I want to have a config file in which I can control the visible property of the textbox controls on both pages. Something like this:-

    <page id = "page1.aspx">

         <controls>
    
             <control1 ID = "Textbox1" Visible = "false">
    
         </controls>
    

    </page>
    <page id = "page2.aspx">

         <controls>
    
             <control1 ID = "Textbox1" Visible = "true">
    
         </controls>
    

    </page>

    M 1 Reply Last reply
    0
    • C Cyberpulse

      Is there a way to create a config file that controls the elements on specific pages. For example I have 2 pages viz. page1.aspx and page2.aspx. I want to have a config file in which I can control the visible property of the textbox controls on both pages. Something like this:-

      <page id = "page1.aspx">

           <controls>
      
               <control1 ID = "Textbox1" Visible = "false">
      
           </controls>
      

      </page>
      <page id = "page2.aspx">

           <controls>
      
               <control1 ID = "Textbox1" Visible = "true">
      
           </controls>
      

      </page>

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Well, you could create an HttpModule that reads the config file, identifies the current page, and injects a Load or PreRender event handler to hide or display controls. Can I ask why you would want to do this? What's wrong with setting the property on the page?

      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