[CLOSED] Text value of TextField object in UserControl

  1. #1

    [CLOSED] Text value of TextField object in UserControl

    Test.aspx
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="B2B.WEB.Test" %>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
    
        <ext:ResourceManager runat="server" />
    
        <ext:TextField ID="TextField1" runat="server" />
        <ext:Button ID="ButtonTestASPX" runat="server" Text="test ASPX" Icon="Accept" OnDirectClick="ButtonTestASPX_Click" />
    
        <ext:Panel ID="PanelControl" runat="server" Width="500" Border="true" />
    
        </form>
    </body>
    </html>
    Test.aspx.vb
    Public Class Test
        Inherits System.Web.UI.Page
    
        Private Sub Test_Load(sender As Object, e As EventArgs) Handles Me.Load
            Dim ControlApp As New Ext.Net.UserControlLoader
            ControlApp.Path = "Control.ascx"
            PanelControl.Items.Add(ControlApp)
            PanelControl.UpdateContent()
        End Sub
    
        Protected Sub ButtonTestASPX_Click(sender As Object, e As Ext.Net.DirectEventArgs)
            Ext.Net.X.Msg.Alert("Message", TextField1.Text).Show()
        End Sub
    
    End Class
    Control.ascx
    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Control.ascx.vb" Inherits="B2B.WEB.Control" %>
    
    <ext:TextField ID="TextField1" runat="server" />
    <ext:Button ID="ButtonTestASCX" runat="server" Text="test ASCX" Icon="Accept" ClientIDMode="Static" OnDirectClick="ButtonTestASCX_Click" />
    Control.ascx.vb
    Public Class Control
        Inherits System.Web.UI.UserControl
    
        Protected Sub ButtonTestASCX_Click(sender As Object, e As Ext.Net.DirectEventArgs)
            Ext.Net.X.Msg.Alert("Message", TextField1.Text).Show()
        End Sub
    
    End Class
    When I click on TestASPX Button, all OK.
    When I click on TestASCX Button, nothing is showed...

    Help, please!
    Last edited by Daniil; Nov 21, 2014 at 3:02 PM. Reason: [CLOSED]
  2. #2
    Hi @Mario,

    Please remove:
    PanelControl.UpdateContent()
    It should be called during a DirectEvent only if needed to update the PanelControl's content.
    Last edited by Daniil; Nov 21, 2014 at 3:01 PM.

Similar Threads

  1. [CLOSED] Text value of TextField object
    By Mario in forum 2.x Premium Help
    Replies: 2
    Last Post: Nov 13, 2014, 7:59 PM
  2. [CLOSED] Retrieve Object TextField
    By mapperez in forum 2.x Premium Help
    Replies: 1
    Last Post: Aug 11, 2014, 5:23 PM
  3. [CLOSED] TextField Binding with sub object
    By jdacosta in forum 2.x Premium Help
    Replies: 1
    Last Post: Nov 13, 2013, 10:25 PM
  4. Replies: 5
    Last Post: Aug 16, 2013, 2:40 PM
  5. Get TextField Values From UserControl
    By gpcontreras in forum 1.x Help
    Replies: 2
    Last Post: Feb 01, 2010, 10:25 AM

Tags for this Thread

Posting Permissions