develop a Web Custom Control

Discussion in 'ASP .Net Web Controls' started by Mahesh, Sep 3, 2003.

  1. Mahesh

    Mahesh Guest

    I tried to develop a Web Custom Control and it is shown
    below.

    Imports System.Web.UI.WebControls
    Imports System.Web.UI
    Imports System.ComponentModel

    Namespace Grid
    Public Class MyGrid
    Inherits System.Web.UI.WebControls.WebControl

    Protected Overrides Sub CreateChildCOntrols()
    Dim tempTable As New Table()
    Dim x As New TableCell()
    Dim x1 As New TableCell()
    Dim y As New TableRow()
    x.Text = "test1"
    x1.Text = "test2"
    y.Cells.Add(x)
    y.Cells.Add(x1)
    tempTable.Rows.Add(y)
    tempTable.Attributes.Add("border", "1")
    Controls.Add(tempTable)
    End Sub

    Protected Overrides Sub render(ByVal output As
    HtmlTextWriter)
    EnsureChildControls()
    RenderChildren(output)
    End Sub
    End Class
    End Namespace



    It generates a table, with 2 cells in one row.
    I have few questions about it. I very much appreciate if
    anyone can help me find answers to these questions?

    1. How do I change the properties of the table in the
    design mode?
    2. I want to display my own properties. So, how do I
    display "customizedtableheaders" under 'property'? How do
    I display 2 sub properties (headertext1 & headertext2)
    under "customizedtableheader"?
    3. When I enter a string value to the "headertext1"
    property in the design mode, I want that value to display
    in the first cell in the table as a text in the design
    mode. The same has to be done with the "headertext2" and
    the second cell in the table. How do I do it?
    4. How do make the width and the height of the table
    change, by dragging it with the mouse?

    Please reply me soon if you know the solutions. Thanks a
    lot.
    Mahesh, Sep 3, 2003
    #1
    1. Advertising

  2. Mahesh

    Rajesh.V Guest

    If u have msdn installed in ur system, this link will give u all the answers

    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dnmag02/html/webc.htm



    "Mahesh" <> wrote in message
    news:030201c371fd$a60cb0e0$...
    >
    > I tried to develop a Web Custom Control and it is shown
    > below.
    >
    > Imports System.Web.UI.WebControls
    > Imports System.Web.UI
    > Imports System.ComponentModel
    >
    > Namespace Grid
    > Public Class MyGrid
    > Inherits System.Web.UI.WebControls.WebControl
    >
    > Protected Overrides Sub CreateChildCOntrols()
    > Dim tempTable As New Table()
    > Dim x As New TableCell()
    > Dim x1 As New TableCell()
    > Dim y As New TableRow()
    > x.Text = "test1"
    > x1.Text = "test2"
    > y.Cells.Add(x)
    > y.Cells.Add(x1)
    > tempTable.Rows.Add(y)
    > tempTable.Attributes.Add("border", "1")
    > Controls.Add(tempTable)
    > End Sub
    >
    > Protected Overrides Sub render(ByVal output As
    > HtmlTextWriter)
    > EnsureChildControls()
    > RenderChildren(output)
    > End Sub
    > End Class
    > End Namespace
    >
    >
    >
    > It generates a table, with 2 cells in one row.
    > I have few questions about it. I very much appreciate if
    > anyone can help me find answers to these questions?
    >
    > 1. How do I change the properties of the table in the
    > design mode?
    > 2. I want to display my own properties. So, how do I
    > display "customizedtableheaders" under 'property'? How do
    > I display 2 sub properties (headertext1 & headertext2)
    > under "customizedtableheader"?
    > 3. When I enter a string value to the "headertext1"
    > property in the design mode, I want that value to display
    > in the first cell in the table as a text in the design
    > mode. The same has to be done with the "headertext2" and
    > the second cell in the table. How do I do it?
    > 4. How do make the width and the height of the table
    > change, by dragging it with the mouse?
    >
    > Please reply me soon if you know the solutions. Thanks a
    > lot.
    >
    >
    Rajesh.V, Sep 10, 2003
    #2
    1. Advertising

  3. Mahesh

    Mahesh Guest

    Idont have MSDN on my computer to check the help page that
    you have sent me. i very much appriceate if you can send
    me the part that i need in a zip file or in a word
    document or you can send me the internet path in
    msdn.microsoft.com to go to that help page.thank you very
    much for your help
    Mahesh, Sep 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Sokol
    Replies:
    2
    Views:
    378
    Theo Tillotson
    Aug 7, 2003
  2. kicki

    Develop a Server Control problem, page dowloads

    kicki, Oct 1, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    136
    kicki
    Oct 1, 2003
  3. Patsy

    develop activex control in c# .net

    Patsy, Apr 5, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    210
    Patsy
    Apr 5, 2005
  4. news.microsoft.com

    AspNetHostingPermission trouble - How do you develop custom controls?

    news.microsoft.com, May 24, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    127
    news.microsoft.com
    May 24, 2004
  5. seef gordon
    Replies:
    14
    Views:
    164
    A. Sinan Unur
    Mar 2, 2009
Loading...

Share This Page