locked
how to configure server controls in web/machine config? RRS feed

  • Question

  • User1922541779 posted

    Hi   I read in a book about asp.net that server controls are configurable in machine and web config file  ,and this will allow editing them without need to recompile. But I searched and could not find how to do it. My question is suppose I have textbox on my page  how can I set its properties in the web.config?thanks in advance

    Saturday, March 16, 2019 1:10 AM

Answers

  • User-1174608757 posted

    Hi kobosh,

    server controls are configurable in machine and web config file 

    Do you mean codes in config as below?

    <pages>
    
          <controls>
    
            <add tagPrefix="ajaxToolkit"  namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
    
            <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
    
              assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    
          </controls>
    
        </pages>

    These code shows the class inherited by control using in page. In fact all controls in the aspx page inherit their own classes, and when we want to use them, we will register them in the web.config file. However, we can't directly modify the control properties in config. If you mentioned in your book how to modify the servercontrol code in cofig, I hope you can share it.

    Best Regards

    Wei

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2019 2:14 AM