Results 1 to 6 of 6

Thread: How to Create Server Controls in ASP.NET

  1. #1
    Join Date
    Feb 2010
    Posts
    181

    How to Create Server Controls in ASP.NET

    Hi all,

    I decided to create my own custom server controls. I try to inherit a label control, but the label control does not support scroll bars. So, I chose to inherit Panel control. The ultimate control with a Panel control all of the properties (color, borders, scroll support, etc.), plus I add some custom attributes. Using the Panel control will make the smallest effort. So i know that how to create server control in ASP.NET. Thanks in advance.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    How to Create Server Controls in ASP.NET

    I have built a Custom Server Control for that initialization of the server control is relatively easy. The following is the final code:

    Code:
    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.ComponentModel;
    usingSystem.Web.Caching;
    usingSystem.Web.UI;
    usingSystem.Web.UI.WebControls;
    
    [assembly: TagPrefix ("EndWell123", "EW123")]
    namespaceEndWell123
    {
    [DefaultProperty ("Text")]
    [ToolboxData ("<(0): HyperlinkFileList runat ="server">")]
    [ToolboxBitmap ("HyperlinkFileList123.ico")]
        
        public classHyperlinkFileList123: Panel
        {
    [Bindable (true)]
    [Category ("Files List")]
    [Description ("The Title of the list of files")]
            public stringFilesTitle123 (get; set;}
    
    [Bindable (true)]
    [Category ("Files List")]

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    How to Create Server Controls in ASP.NET

    The server control is basically a div panel built up into a div, and then set the "display" property to "inline-block", to allow multiple controls have been side by side. You can select the following code :
    Code:
    Style ["display"] = "inline-block";
    I do not like the text to the left of the control card, so I add some CSS to fill. I have also controls around the use of some css styles. Check and reply.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    How to Create Server Controls in ASP.NET

    I found the control to run every time, it will be re-read the file directory. File input and output price is very expensive. I want to go with the server control's "State". But it uses the View State type, two to send the file list to the client is a very low efficiency. Time as a HTML list, and one in ViewState.So I want to use Session State, Application State and Cache.I have decided to list of files being placed in a cache object. So that the list can be shared between the session. If memory overflow, the cache list will be lost. Check and reply.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    How to Create Server Controls in ASP.NET

    I will file directory and file filter connected together, as the cache key. This allows multiple controls at the same time the use and sharing of file list.At first, I added to enable developers to force re-read the documents required functionality. However, the cache object can use the dependency relationship: Any changes will lead to a subordinate directory cache expires. The final code is very simple:
    Code:
    Page.Cache.Insert (FilesDirectory +FilesFilter, 
    m_FilesArray, 
     newCacheDependency (FullPath));

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    How to Create Server Controls in ASP.NET

    I will you some tips about the Server Controls in ASP.NET. You should not UrlEditor, because it is not allowed to visit the external site's home directory.
    Code:
    [EditorAttribute (typeof (System.Windows.Forms.Design.FolderNameEditor), typeof (UITypeEditor))]
    You do not use FolderNameEditor, because it does not provide a virtual path of choice. In addition, it forces the user to select one I do not want to select the file.

Similar Threads

  1. create a RAMdisk on the server
    By MassMan in forum Networking & Security
    Replies: 3
    Last Post: 07-03-2011, 06:31 AM
  2. how to create server
    By Innis in forum Networking & Security
    Replies: 4
    Last Post: 27-02-2011, 04:52 AM
  3. How to disable ASP.NET Server Controls validation
    By Ransom in forum Software Development
    Replies: 4
    Last Post: 21-02-2010, 12:21 AM
  4. How to Create ActiveX Controls in Visual Basic 6
    By geokilla in forum Software Development
    Replies: 3
    Last Post: 30-09-2009, 03:36 PM
  5. How to create an FTP server with a few clicks
    By Mastermind in forum Guides & Tutorials
    Replies: 1
    Last Post: 12-11-2008, 01:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,552,184.64307 seconds with 17 queries