码迷,mamicode.com
首页 > Web开发 > 详细

asp.net 自带ajax 控件的小实例

时间:2014-07-16 16:49:15      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   width   for   

 <form id="Form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Label ID="Label1" runat="server" Text="车牌号:"></asp:Label>
        <asp:TextBox ID="tbVehicleLic" runat="server"></asp:TextBox>
        <asp:Label ID="Label2" runat="server" Text="离线间隔(分钟):"></asp:Label>
        <asp:TextBox ID="tbTimeSpan" runat="server">30</asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" Text="查询" Width="80px" />
    </div>
    <div>    
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
          <!--下面是一个报表--> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%" Height="70%"> <LocalReport ReportPath="bin\Pages\Report\LastOnlineRpt.rdlc"> </LocalReport> </rsweb:ReportViewer> </ContentTemplate> </asp:UpdatePanel> </div> </form>

后台

 protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager1.RegisterAsyncPostBackControl(btnSearch);//给按钮注册异步事件
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string vehicleLic = this.tbVehicleLic.Text;
            double timeSpan = Convert.ToDouble(this.tbTimeSpan.Text);
            string lineID = "164,165,166,167";
            MainBLL bll = new MainBLL();
            var dt = bll.GetBusStatusByLineID(lineID, vehicleLic, timeSpan);
            ReportDataSource ReportData = new ReportDataSource("DataSet1", dt);
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(ReportData);
            //this.UpdatePanel1.Update();
        }

asp.net 自带ajax 控件的小实例,布布扣,bubuko.com

asp.net 自带ajax 控件的小实例

标签:style   blog   color   os   width   for   

原文地址:http://www.cnblogs.com/yangxinghua/p/3848616.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!