<formID= "Form1"runat= "Server"> <Asp:scriptmanagerID= "ScriptManager1"runat= "Server"> </Asp:scriptmanager> <Div> <Asp:labelID= "Label1"runat= "Server"Text= "License plate number:"></Asp:label> <Asp:textboxID= "Tbvehiclelic"runat= "Server"></Asp:textbox> <Asp:labelID= "Label2"runat= "Server"Text= "offline interval (minutes):"></Asp:label> <Asp:textboxID= "Tbtimespan"runat= "Server">30</Asp:textbox> <Asp:buttonID= "Btnsearch"runat= "Server"onclick= "btnSearch_Click"Text= "Query"Width= "80px" /> </Div> <Div> <Asp:updatepanelID= "UpdatePanel1"runat= "Server"> <ContentTemplate>
<!--Here's a report--<Rsweb:reportviewerID= "ReportViewer1"runat= "Server"Font-names= "Verdana"font-size= "8pt"Interactivedeviceinfos= "(collection)"Waitmessagefont-names= "Verdana"waitmessagefont-size= "14pt"Width= "100%"Height= "70%"> <LocalReportReportpath= "BIN\PAGES\REPORT\LASTONLINERPT.RDLC"> </LocalReport> </Rsweb:reportviewer> </ContentTemplate> </Asp:updatepanel> </Div> </form>
Background
protected voidPage_Load (Objectsender, EventArgs e) {Scriptmanager1.registerasyncpostbackcontrol (btnsearch);//registering an asynchronous event for a button } protected voidbtnSearch_Click (Objectsender, EventArgs e) { stringVehiclelic = This. Tbvehiclelic.text; DoubleTimeSpan = Convert.todouble ( This. Tbtimespan.text); stringLineID ="164,165,166,167"; MAINBLL BLL=NewMAINBLL (); varDT =BLL. Getbusstatusbylineid (LineID, Vehiclelic, TimeSpan); ReportDataSource ReportData=NewReportDataSource ("DataSet1", DT); ReportViewer1.LocalReport.DataSources.Clear (); REPORTVIEWER1.LOCALREPORT.DATASOURCES.ADD (ReportData); //This . Updatepanel1.update ();}