Custom Server Control Textfield

  1. #1

    Custom Server Control Textfield

    Hi,
    I wrote my Server Control Textfield by inherits from Ext.Net.Textfield.
    When I use it in a form I get always empty string in it's Text value in code behind during form submit.
    It happens only with my textfield because if I use the basic textfield I have no problem.
    Do I miss something? Thank you
    My Server Control code

        public class MyTextField : Ext.Net.TextField
        {
            [Category("Text")]
            string _id = "";
    
            public MyTextField():base()
            {
              
            }
    
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                this.ID = id;
                
            }
    
            public string id
            {
                get { return _id; }
                set
                {
                    _id = value;
    
                }
            }
    }
    Last edited by m_bo; Mar 29, 2012 at 2:17 PM.
  2. #2
    Hi,

    I was unable to reproduce. Please provide a full sample.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I was unable to reproduce. Please provide a full sample.
    Thank you,
    I think that the problem was that I was using master pages, if I put the form and my control inside a page without the connection to the master page everything goes ok.

    
    <ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="X"
            IDMode="Explicit" />
    <form id="form1" runat="server">
    	<ext:Panel ID="Panel1" runat="server">
    		<Items>
    		   <N:MyTextField id="test" runat="server"  FieldLabel="Test" ></N:MyTextField>
    		   <ext:Button ID="Button1" runat="server" OnDirectClick="Button1_Click"></ext:Button>
    		</Items>
    	</ext:Panel>
    </form>
  4. #4
    It should work with a MasterPage as well. Please provide a sample where it doesn't work.

Similar Threads

  1. [CLOSED] AjaxMethod in Custom Server Control
    By jon in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 30, 2016, 2:18 PM
  2. [CLOSED] Creating custom control on server side
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 21, 2012, 10:15 AM
  3. Replies: 2
    Last Post: Jan 09, 2012, 7:18 AM
  4. [CLOSED] Create web server control (composite control)
    By mmmartins in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: May 13, 2011, 6:18 PM
  5. [CLOSED] [1.0] Accessing instance of store defined in custom server control
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 28, 2010, 6:29 PM

Tags for this Thread

Posting Permissions