Creating Server Control: Cant get Properties to show in Properties Windows in VS.NET!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Creating Server Control: Cant get Properties to show in Properties Windows in VS.NET!

  1. #1
    Lars Netzel Guest

    Creating Server Control: Cant get Properties to show in Properties Windows in VS.NET!

    I'm trying to make a Server Control (just to learn, no specific use).

    This Servercontrol will get the "Text" and "Rows" propterties and then type the text as many times as the Rows says. It works fine but I can't see the "Rows" property in the property windows oF Visual Studio... The Text property is present but I guess it's because I inherits the Webcontrol class and get it "For free"...



    Imports System.ComponentModel

    Imports System.Web.UI



    Public Class PrintText

    Inherits System.Web.UI.WebControls.WebControl

    Dim _text As String

    Dim _numberofrows As Integer

    Property [Text]() As String

    Get

    Return _text

    End Get

    Set(ByVal Value As String)

    _text = Value

    End Set

    End Property

    Property Rows() As Integer

    Get

    Return _numberofrows

    End Get

    Set(ByVal Value As Integer)

    _numberofrows = Value

    End Set

    End Property



    Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

    Dim I

    For I = 0 To Rows

    output.Write([Text] & "<br>")

    Next I

    End Sub

    End Class



    Please Help!



    Thanks

    /Lars Netzel



  2. #2
    Lars Netzel Guest

    Re: Creating Server Control: Cant get Properties to show in Properties Windows in VS.NET!

    I fixed it myself.. I used had to update the reference to the DLL and then it worked!

    /Lars
    "Lars Netzel" <lars.netzel@ehandel.sigma.se> wrote in message news:3ecb572d@tnews.web.devx.com...
    I'm trying to make a Server Control (just to learn, no specific use).

    This Servercontrol will get the "Text" and "Rows" propterties and then type the text as many times as the Rows says. It works fine but I can't see the "Rows" property in the property windows oF Visual Studio... The Text property is present but I guess it's because I inherits the Webcontrol class and get it "For free"...



    Imports System.ComponentModel

    Imports System.Web.UI



    Public Class PrintText

    Inherits System.Web.UI.WebControls.WebControl

    Dim _text As String

    Dim _numberofrows As Integer

    Property [Text]() As String

    Get

    Return _text

    End Get

    Set(ByVal Value As String)

    _text = Value

    End Set

    End Property

    Property Rows() As Integer

    Get

    Return _numberofrows

    End Get

    Set(ByVal Value As Integer)

    _numberofrows = Value

    End Set

    End Property



    Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

    Dim I

    For I = 0 To Rows

    output.Write([Text] & "<br>")

    Next I

    End Sub

    End Class



    Please Help!



    Thanks

    /Lars Netzel



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center