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 cutomise a Usercontrol Solved [modified]

How to cutomise a Usercontrol Solved [modified]

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
5 Posts 3 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
    alaminfad
    wrote on last edited by
    #1

    Hello All i've a usercontrol with alot of items i want to customize it for each individual page ,for instance making some textboxes,buttons invisible in a particular page , how to? thanks

    modified on Sunday, November 8, 2009 1:39 AM

    A 1 Reply Last reply
    0
    • A alaminfad

      Hello All i've a usercontrol with alot of items i want to customize it for each individual page ,for instance making some textboxes,buttons invisible in a particular page , how to? thanks

      modified on Sunday, November 8, 2009 1:39 AM

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      What is the problem. Expose some properties from the usercontrol to set it from any page. :rose:

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      F A 2 Replies Last reply
      0
      • A Abhishek Sur

        What is the problem. Expose some properties from the usercontrol to set it from any page. :rose:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        F Offline
        F Offline
        FEMDEV
        wrote on last edited by
        #3

        check the properties of the user control you are using. Also u can add controls to it like text box etc , if it supports them and then set the properties as per you requirment. If the user control doesn't support then change to a custom aspx control as per your requirments.

        1 Reply Last reply
        0
        • A Abhishek Sur

          What is the problem. Expose some properties from the usercontrol to set it from any page. :rose:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          A Offline
          A Offline
          alaminfad
          wrote on last edited by
          #4

          Thank you sir , but i was thinking of having a sub that handles all the control intead of exposing each individual item , i vame up with this sub , and it works just fine Public Sub _DisableCont(ByVal Cont_Str As String) Dim _Control As Control For Each _Control In Me.Controls Dim _ControlToString As String = _Control.ToString If _ControlToString = Cont_Str Then _Control.Visible = False End If Next End Sub :)

          A 1 Reply Last reply
          0
          • A alaminfad

            Thank you sir , but i was thinking of having a sub that handles all the control intead of exposing each individual item , i vame up with this sub , and it works just fine Public Sub _DisableCont(ByVal Cont_Str As String) Dim _Control As Control For Each _Control In Me.Controls Dim _ControlToString As String = _Control.ToString If _ControlToString = Cont_Str Then _Control.Visible = False End If Next End Sub :)

            A Offline
            A Offline
            Abhishek Sur
            wrote on last edited by
            #5

            Just see you have already did yourself. Our main motive is to help you to solve your own problem yourself. Just to add to your solution, if you need any particular control to do something else check using this :

            If TypeOf(_Control) is TextBox Then
            Dim tb as TextBox = DirectCast(_Control, TextBox)
            tb.ReadOnly = True
            End If

            You might also take Select Case in account for this scenario. Cheers. :rose:

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->** Simplify Code Using NDepend
            Basics of Bing Search API using .NET
            Microsoft Bing MAP using Javascript

            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