Prblm Web Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mohitkatariya
    New Member
    • Apr 2007
    • 26

    #1

    Prblm Web Control

    i have having problem regarding web user control
    i want to make a property from which user can select the mode of the control
    like the type of char. textbox can accept as 'only char' or 'only number' etc
    how can i do this
    Plz help me regarding this
    Thanx
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Have you tried using a class?

    Comment

    • oohay251
      New Member
      • May 2007
      • 27

      #3
      That's exactly what you must do - make a Property.

      In your control:

      private _onlyChar = false; //or whatever default value you want for the control
      public bool onlyChar
      {
      get { return _onlyChar; }
      set { _onlyChar = value; }
      }

      the property will be exposed for use:
      <%@ Register src="~/mycontrol.ascx" Tagname="myCtl" Tagprefix="ctl" %>

      <ctl:myCtl onlyChar="true" .... />

      Comment

      • mohitkatariya
        New Member
        • Apr 2007
        • 26

        #4
        Originally posted by kenobewan
        Have you tried using a class?
        No I have used Class in this problem how can i use class to solve this prblm, if u have any suggestions plz write
        Thanks

        Comment

        Working...