我在我的项目中使用Asp.net和Mobile jquery。我想在单击向上和向下按钮中按钮文本更改。它在System Chrome浏览器中完美运行。但我的移动浏览器 - opera mobile,它不显示文本。(按钮是空白甚至上下也不显示。)什么是错误?。
我希望你能理解我的问题。我在下面提供我的代码以供参考......
ASPX -
<div id="body" class="ui-content ui-body-a" >
<div class="ui-grid-b">
<div class="ui-block-a"><asp:Button ID="Button1" runat="server" Text="Button" /></div>
<div class="ui-block-b"> <asp:Button ID="Button2" runat="server" Text="Button" /></div>
<div class="ui-block-c"> <asp:Button ID="btnUp" runat="server" Text="UP" onclick="btnUp_Click" /></div>
<div class="ui-block-a"><asp:Button ID="Button3" runat="server" Text="Button" /></div>
<div class="ui-block-b"><asp:Button ID="Button4" runat="server" Text="Button" /></div>
<div class="ui-block-c"> <asp:Button ID="Button5" runat="server" Text="Button" /></div>
<div class="ui-block-a"><asp:Button ID="Button6" runat="server" Text="Button" /></div>
<div class="ui-block-b"><asp:Button ID="Button7" runat="server" Text="Button" /></div>
<div class="ui-block-c"> <asp:Button ID="Button8" runat="server" Text="Button" /></div>
<div class="ui-block-a"><asp:Button ID="Button9" runat="server" Text="Button" /></div>
<div class="ui-block-b"><asp:Button ID="Button10" runat="server" Text="Button" /></div>
<div class="ui-block-c"><asp:Button ID="btnDown" runat="server" Text="DOWN" onclick="btnDown_Click" /></div>
</div><!-- /grid-b -->
C#
public int btn_click, tot;
string[] roomno = new string[100];
int i = 0;
protected void Page_Load(object sender, EventArgs e)
{
//MySqlConnection connection = new MySqlConnection(GlobalClass.GlobalConnString.ToString());
//string query = "SELECT Table_Entry_TableNo FROM fb_table_entry where Table_entry_OutletId ='"+ GlobalClass.GlobaloutletId +"' and Table_Entry_DeleteStatus = '0' order by CAST(Table_Entry_TableNo AS UNSIGNED), Table_Entry_TableNo";
//MySqlCommand command = new MySqlCommand(query, connection);
//connection.Open();
//MySqlDataReader Reader = command.ExecuteReader();
//while (Reader.Read())
//{
//}
//connection.Close();
if (!Page.IsPostBack)
{
ViewState["btn"] = "1";
ViewState["tot"] = "0";
btn_click = Convert.ToInt32(ViewState["btn"].ToString());
int vallen = 45;
int len = vallen;
while (len > 10)
{
len = len - 10;
tot++;
}
if (len != 0) tot++;
ViewState["tot"] = tot;
for (int j = 0; j <= vallen; j++)
{
roomno[j] = "A" + Convert.ToString(j + 1);
}
ViewState["roomno"] = roomno;
//i = 20;
fun();
}
}
private void fun()
{
btn_click = Convert.ToInt32(ViewState["btn"].ToString());
i = 10 * (btn_click);
roomno = ViewState["roomno"] as string[];
Button1.Text = roomno[i - 10];
Button2.Text = roomno[i - 9];
Button3.Text = roomno[i - 8];
Button4.Text = roomno[i - 7];
Button5.Text = roomno[i - 6];
Button6.Text = roomno[i - 5];
Button7.Text = roomno[i - 4];
Button8.Text = roomno[i - 3];
Button9.Text = roomno[i - 2];
Button10.Text = roomno[i - 1];
//enabledFn();
}
private void enabledFn()
{
//var buttons = this.tableLayoutPanel1.Controls.OfType<Button>();
//foreach (var button in buttons)
//{
// if (button.Text != "")
// {
// button.Enabled = true;
// }
// else
// {
// button.Enabled = false;
// }
//}
}
protected void btnUp_Click(object sender, EventArgs e)
{
tot = Convert.ToInt32(ViewState["tot"].ToString());
btn_click = Convert.ToInt32(ViewState["btn"].ToString());
if (btn_click != 1) { btn_click--; ViewState["btn"] = btn_click; fun(); }
Button1.Text = Convert.ToString(btn_click);
}
protected void btnDown_Click(object sender, EventArgs e)
{
tot = Convert.ToInt32(ViewState["tot"].ToString());
btn_click = Convert.ToInt32(ViewState["btn"].ToString());
if (btn_click < tot) { btn_click++; ViewState["btn"] = btn_click; fun(); }
Button1.Text = Convert.ToString(btn_click);
}
}
答案 0 :(得分:1)
在js文件中查找按钮样式代码。我想,..按钮有文字,但它可能是摆动或折叠。尝试在各种浏览器和平铺手机,看看是否看起来像文本?。