Hi, everyone. When i try my first j-mobile program, i can't get the right value from textbox controls after the first click with Button1. It always bring me "<first value>,<current value>". The code is very simple, can anyone help me? Visual studio 2010/2013 webform. Thanks!
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="Scripts/jquery.mobile-1.4.4.css">
<script src="Scripts/jquery-1.10.2.min.js"></script>
<script src="Scripts/jquery.mobile-1.4.4.min.js"></script><!-- if remark this line, things go right-->
</head>
<body>
<form id="form1" runat="server">
<div data-role="page">
<div data-role="header">
<h1>Header</h1>
</div>
<div data-role="content">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input type="text" name="test1" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</div>
<div data-role="footer">
<h1>Footer</h1>
</div>
</div>
</form>
</body>
</html>
And the button click event goes here:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
Label2.Text = Request.Form["test1"];
}