Oct 04, 2016, 12:33 PM
[CLOSED] [#1389] [4.2.0] TextField - CodeBehind problem
Hi,
I just start using Ext.Net Mobile Web Forms. As old Ext.Net WebForms developer, i tried to apply the same approach.
Here an example using TextField and two buttons:
Markup:
Any idea?
I just start using Ext.Net Mobile Web Forms. As old Ext.Net WebForms developer, i tried to apply the same approach.
Here an example using TextField and two buttons:
Markup:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Mobile.WebForm1" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Mobile Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="VBoxLayout" Padding="10">
<Items>
<ext:FormPanel
ID="FormPanel1"
runat="server" >
<Items>
<ext:TitleBar ID="TitleBar1" runat="server" Docked="Top">
<Items>
<ext:Button ID="Button1" runat="server" Text="Get" OnClientTap="INTG.GetFormValues();" />
<ext:Button ID="Button2" runat="server" Text="Set" OnClientTap="INTG.SetFormValues();" />
</Items>
</ext:TitleBar>
<ext:FieldSet
ID="FieldSet1"
runat="server"
<Items>
<ext:TextField ID="TextField1" runat="server" Label="Title" Text="test" />
</Items>
</ext:FieldSet>
</Items>
</ext:FormPanel>
</Items>
</ext:Viewport>
</body>
</html>
CodeBehind:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net.Mobile;
namespace Mobile
{
public partial class WebForm1 : System.Web.UI.Page
{
[DirectMethod(ShowMask = true)]
public void SetFormValues()
{
TextField1.Text = "TESSSSSST";
}
[DirectMethod(ShowMask = true)]
public void GetFormValues()
{
X.Msg.Alert("", TextField1.Text).Show();
}
}
}
The problem is that im not able to change the TextField text from codeBehind.Any idea?
Last edited by fabricio.murta; Nov 02, 2016 at 4:10 AM.