微信网页电话簿-jquery mobile 工具vs2010

2 篇文章 0 订阅

前端:



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
    <title>电话薄</title>
</head>
<body>
    <form id="form1" runat="server">
<div data-role="page" id="pageone">
  <div data-role="content">
  <%--    <p>
          <asp:Label ID="Label2" runat="server" Text="请输入姓名"></asp:Label>
      </p>--%>
        <h4>请输入员工准确姓名:</h4>
      <p>
      <asp:TextBox ID="TextBox1" runat="server"  Font-Bold="True" Font-Size="Medium" ></asp:TextBox>
      </p>
 


      <asp:Button ID="Button1" runat="server" Text="查询" OnClick="Button1_Click"  />

    <h4>查询结果:</h4>
    <ul data-role="listview" data-inset="true">
           <%   if (aa[0] == "1")
        {%>
      <li>未查到该员工的信息</li>
      <%  };%>

         <%   if (aa[0] != "1")
        {%>
      <li><%=aa[0] %></li>
      <%  };%>


     <%   if (aa[1] != "2")
        {%>
      <li><%=aa[1] %></li>
      <%  };%>
     

           <%   if (aa[2] != "3")
        {%>
      <li><%=aa[2] %></li>
      <%  };%>
    </ul>
  </div>
   
  <div data-role="footer" class="ui-bar-b">
    <h1>信息技术中心提供支持</h1>
  </div>
</div>
    </form>
</body>
</html>


后台


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{

 public   string[] aa = new string[3] { "", "2", "3", };
    protected void Page_Load(object sender, EventArgs e)
    {

    
    }
    protected void Button1_Click(object sender, EventArgs e)

    {
        aa[0] = "1";
        aa[1] = "2";
        aa[2] = "3";

        string str = "data source=2*****7,1433;User ID=l888888s;pwd=l222222288;Initial Catalog=li3344B2s";
        SqlConnection myConnection = new SqlConnection(str);
        myConnection.Open();
        string sqlStr = "select * from tel00 where xm = '" + TextBox1.Text + "' ";
        SqlDataAdapter myDa = new SqlDataAdapter(sqlStr, myConnection);
        DataSet myDs = new DataSet();
        myDa.Fill(myDs);

        //string[] arr = new string[myDs.Tables[0].Rows.Count];
        for (int i = 0; i < myDs.Tables[0].Rows.Count; i++)
        //for (int i = 0; i < myDs.Tables[0].Rows.Count; i++)
        {

            aa[i] = myDs.Tables[0].Rows[i][0].ToString() + "-" + myDs.Tables[0].Rows[i][1].ToString() + "-" + myDs.Tables[0].Rows[i][2].ToString() + "-" + myDs.Tables[0].Rows[i][3].ToString();
            //Response.Write(arr[i]);

        }

        myDa.Dispose();
        myDs.Dispose();
        myConnection.Close();
    }
}


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT技术与企业应用结合的爱好者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值