.net简单页面后台绑定下拉框,按钮,分页 前台aspx页面
一、aspx页面
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdateMTablesQCols.aspx.cs"
    Inherits="BS.EAP.Portal.Business.DataQuery.UpdateMTablesQCols" EnableEventValidation="false" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="../../Controls/UserControl/DateProvider.ascx" TagName="DateProvider"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>查询数据表列</title>
<script src="../../Script/Jquery/jquery-1.5.1.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../Script/Jquery/themes/base/jquery.ui.all.css" />
<script src="../../Script/Jquery/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.button.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.resizable.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="../../Script/Jquery/ui/jquery.effects.core.js" type="text/javascript"></script>
<style type="text/css">
        .x-tree-node
        {
            font-size: 12px;
        }
        .x-grid3-hd-row TD
        {
            font-size: 12px;
        }
        .x-grid3-row TD
        {
            font-size: 12px;
            line-height: 16px;
        }
        .displayNone
        {
            display: none;
        }
        #gvMutiQueResult th
        {
            text-align: center;
        }
    </style>
<script type="text/javascript">
        function ShowRemind() {
if (confirm("请确认是否进行更新多表查询列操作?")) {
                return true;
            } else {
                return false;
            }
}
function ShowHidden(obj) {
            if ($("#div_QueryCon").css("display") == "none") {
                $("#div_QueryCon").css({ "display": "" });
                $(obj).attr("src", "../../App_Themes/Green/Images/Toggle_Up.gif");
                $("#ShowHideCon").attr("innerText", "收起");
            }
            else {
                $("#div_QueryCon").css({ "display": "none" });
                $(obj).attr("src", "../../App_Themes/Green/Images/Toggle_Down.gif");
                $("#ShowHideCon").attr("innerText", "展开");
            }
        }
          </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="true">
        <Services>
            <asp:ServiceReference Path="./QueryInfor.svc" />
        </Services>
    </asp:ScriptManager>
    <ext:ResourceManager ID="ResourceManager1" runat="server" CleanResourceUrl="false" />
    <asp:HiddenField ID="HtmlCurBizType" runat="server" />
    <div>
        <table width="280">
            <tr>
                <td>
                    <img src="../../App_Themes/Green/Images/FormTitle.gif" align="absMiddle" />  <font
                        color="#000000"><b>查询数据表列页面</b></font>
                </td>
            </tr>
            <tr>
                <td class="FormFadeLine" colspan="2">
                     
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <label id="ShowHideCon">
                        收起</label>
                    <img src="../../App_Themes/Green/Images/Toggle_Up.gif" style="border-width: 0; vertical-align: bottom;
                        cursor: pointer;" onclick="ShowHidden(this)" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:HiddenField ID="Hdn_EditConditionID" runat="server" />
                </td>
            </tr>
        </table>
        <div id="div_QueryCon">
            <table id="tb_QuertCondtion" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                          
                    </td>
                </tr>
                <tr>
                    <%-- <td valign="top" style="padding-top: 2px">
                        业务:
                    </td>--%>
                    <td>
                          <asp:Button ID="updateBtn" runat="server" OnClick="BtnUpdate_Click" Text="更新查询列"
                            OnClientClick=" return ShowRemind()" />    
                    </td>
                </tr>
                <tr>
                    <td>
                          
                    </td>
                </tr>
                <tr>
                    <td id="td_Dept" runat="server">
                          业务:
                        <asp:DropDownList ID="drpDept" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpDept_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td id="td_Table" runat="server">
                          表:
                        <asp:DropDownList ID="drpTable" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpTable_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td>
                          <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="BtnQuery_Click" />
                    </td>
                </tr>
                <tr style="height: 10px">
                </tr>
                <tr>
                    <td colspan="2">
                        <hr style="border: 0.5px solid silver; width: 100%; text-align: left" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <asp:UpdatePanel ID="QueryResult" runat="server">
        <ContentTemplate>
            <div id="imageWait" class="displayNone">
                <img alt="请稍候......" src="../../App_Themes/Green/Images/loading.gif" />正在生成查询,请稍候......
            </div>
   <asp:SqlDataSource ID="sqlDSMultiQuery" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnectionString %>"
                ProviderName="<%$ ConnectionStrings:DefaultConnectionString.ProviderName %>">
            </asp:SqlDataSource>
            <asp:GridView ID="gvMutiQueResult" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                OnPageIndexChanging="gvMutiQueResult_PageIndexChanging" PageSize="20" Height="50px">
                <HeaderStyle HorizontalAlign="NotSet" VerticalAlign="NotSet" Wrap="False" Height="20px" />
                <RowStyle BackColor="LightCyan" Font-Bold="False" Font-Overline="False" HorizontalAlign="Center"
                    VerticalAlign="Middle" Wrap="False" />
                <PagerStyle HorizontalAlign="Center" Wrap="True" />
                <PagerTemplate>
                    <div style="margin-left: 200px; text-align: left;">
                        <asp:LinkButton ID="cmdFirstPage" runat="server" CommandName="Page" CommandArgument="First"
                            Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex!=0 %>">首页</asp:LinkButton>
                        <%--<asp:LinkButton ID="cmdPreview" runat="server" CommandArgument="Prev" CommandName="Page"
                    Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex!=0 %>">前一页</asp:LinkButton>--%>
                        <asp:LinkButton ID="LinkButton0" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 %>"
                            CommandName="Page" Visible="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10 != 0 %>">...</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 1 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 0 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 1) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 2 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 1 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 1 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 2) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 3 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 2 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 2 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 3) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 4 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 3 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 3 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 4) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton5" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 5 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 4 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 4 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 5) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton6" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 6 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 5 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 5 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 6) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton7" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 7 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 6 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 6 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 7) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton8" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 8 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 7 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 7 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 8) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton9" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 9 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 8 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 8 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 9) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton10" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 10 %>"
                            Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 9 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>"
                            CommandName="Page" Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex%10 != 9 %>"> <%# ((((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 10) %></asp:LinkButton>
                        <asp:LinkButton ID="LinkButton11" runat="server" CommandArgument="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 11 %>"
                            CommandName="Page" Visible="<%# (((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex/10)*10 + 10 < ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>">...</asp:LinkButton>
                        <%--<asp:LinkButton ID="cmdNext" runat="server" CommandName="Page" CommandArgument="Next"
                    Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex!=((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount-1 %>">后一页</asp:LinkButton>--%>
                        <asp:LinkButton ID="cmdLastPage" runat="server" CommandArgument="Last" CommandName="Page"
                            Enabled="<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex!=((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount-1 %>">尾页</asp:LinkButton>
                        第<asp:Label ID="lblcurPage" runat="server" Text='<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex+1      %>'></asp:Label>页/共<asp:Label
                            ID="lblPageCount" runat="server" Text='<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageCount %>'></asp:Label>页
                        转到第<input type="text" value='<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).PageIndex+1 %>'
                            id="previousSibling" style="width: 20px; height: 13px;" onkeypress="javascript:if(event.keyCode==13){if(/^\d+$/.test(this.value)){__doPostBack('<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).UniqueID %>','Page$'+this.value);}else{alert('必须为数字');return false;}}" />页
                        <input type="button" style="width: 40px" value="Go" onclick="javascript:var o=document.getElementById('previousSibling');if(/^\d+$/.test(o.value)){__doPostBack('<%# ((System.Web.UI.WebControls.GridView)Container.Parent.Parent).UniqueID %>','Page$'+o.value);}else{alert('必须为数字');return false;}" />
                    </div>
                </PagerTemplate>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="divContent" style="display: none">
        <iframe id="frmReport" runat="server" width="100%" height="600px" frameborder="0"
            src="" scrolling="auto"></iframe>
    </div>
    <div style="width: 98%; padding-top: 20px;" id="divLoadingFrame">
        <div id="divLoading" style="display: none">
            <table>
                <tr>
                    <td>
                        <img alt="请稍候......" src="../../App_Themes/Green/Images/loading.gif" />
                    </td>
                    <td valign="middle">
                        正在生成报表,请稍候......
                    </td>
                </tr>
            </table>
        </div>
    </div>
<script type="text/javascript">
        //alert(top.window.document.body.scrollHeight + "," + screen.availHeight);
        document.getElementById("frmReport").height = top.window.document.body.scrollHeight - 240;
    </script>
</form>
</body>
</html>
.net简单页面后台绑定下拉框,按钮,分页 前台aspx页面的更多相关文章
- .net简单页面后台绑定下拉框,按钮,分页 后台cs文件
		
二.cs文件 using System;using System.Collections.Generic;using System.Web.UI;using System.Web.UI.WebCont ...
 - WPF AutoGeneratingColumn 绑定下拉框
		
WPF自动产生列,前台代码: <DataGrid x:Name="Dg" AutoGenerateColumns="True" CanUserAddRow ...
 - ASP.NET MVC中的cshtml页面中的下拉框的使用
		
ASP.NET MVC中的cshtml页面中的下拉框的使用 用上@Html.DropDownList 先记下来..以做备忘...
 - 奥展项目笔记07--vue绑定下拉框和checkbox总结
		
1.vue绑定下拉框 <div class="col-md-1 data"> <select class="form-control " v- ...
 - 表id关联数据获取至页面,制作下拉框多选进行数据多项获取(字段处理)
		
这周完成了一张表单,重点碰到以下问题: 1.freemaker获取年份的type值取year,类型直接为Long,传至后台和获取数据不需要转换: 2.freemaker获取日期type值为date, ...
 - MVC4 绑定下拉框方法,解决编辑时不绑定值
		
方法一 Controller 部分代码: public ActionResult Modify(int id) { //3.1.1 检查id //3.1.2根据id查询数据 Models.Stude ...
 - Select级联菜单,用Ajax获取Json绑定下拉框(jQuery)
		
需求类似这样 ↓ ↓ ↓ --> 菜单A发生变化,动态取数据填充下拉菜单B. JS代码如下: <script type="text/javascript"& ...
 - jquery easyui无法绑定下拉框内容
		
最近在研究jquery easyui的DataGrid,发现DataGrid中的下拉框无法绑定值,找了很久也没发现是具体问题所在,最后还是同事帮忙搞定的.具体问题竟然是jquery easyui提供的 ...
 - 绑定下拉框时避免触发SelectedIndexChanged事件
		
在从数据库读取数据集绑定到下拉框时会立即触发其SelectedIndexChanged事件造成异常,可对其SelectedIndexChanged事件采取先解除后附加的方法解决. cmbXl_gt.V ...
 
随机推荐
- Swift - IBOutlet返回nil(fatal error: unexpectedly found nil while unwrapping an Optional value)
			
在Swift 中 ViewController 默认构造方法不关联同名的xib文件 在使用OC的时候,调用ViewController的默认构造函数,会自动关联到一个与ViewController名字 ...
 - CSS学习笔记总结和技巧
			
跟叶老师说项目,他叫我写一个静态首页,看起来挺简单的,但是下手才发现在真的不会怎么下手啊,什么模型啊模块啊都不懂,写毛线啊!! 如图:页面下拉还有侧栏,中间内容等. 可是答应跟老师做了,不能怂啊,于是 ...
 - JS全部API笔记
			
我相信对于程序猿都有做笔记的习惯. 我初学到现在也做了不少笔记,以前,总是怕写的文章或者好的内容分享出来就怕被直接copy以后更个名就不再是你的. 但通过博客园,学习到不少东西,人家都不怕什么了,我自 ...
 - win7下的iis配置
			
1.配置错误 说明:在处理向该请求提供服务所需的配置文件时出错.请检查下面的特定错误详细信息并适当地修改配置文件. 分析器错误消息:无法识别的属性“targetFramework”.请注意属性名称区分 ...
 - angularjs学习笔记—事件指令
			
ngClick 适用标签:所有触发条件:单击 #html <div ng-controller="LearnCtrl"> <div ng-click=" ...
 - AFNetworking使用总结
			
AFNetworking使用总结 关于AFNetworking使用总结 以及一些错误的解决办法. AD:WOT2015 互联网运维与开发者大会 热销抢票 AFNetworking使用总结 分享类型 ...
 - python的pyc和pyo文件
			
python并非完全是解释性语言,它是有编译的,先把源码py文件编译成pyc或者pyo,然后由python的虚拟机执行,相对于py文件来说,编译成pyc和pyo本质上和py没有太大区别,只是对于这个模 ...
 - FJ省队集训最终测试 T3
			
思路:状态压缩dp,f[i][j[[k]代表i行j列这个格子,连续的状态为k,这个连续的状态是什么?就是下图 X格子代表我当前走到的地方,而这里的状态就是红色部分,也就是连续的一段n的状态,我们是分每 ...
 - Altium Designer规则
			
1.PCB规则 是PCB设计中至关重要的一个环节:保证PCB符合电气要求.机械加工(精度)要求:为自动布局.布线和部分手动布局.布线操作提供依据 为规则检查提供依据,PCB编辑期间,AD会实时地进行一 ...
 - SQL Server  通过一个表和另一个表联合 批量更新这个表的字段
			
UPDATE OutPzPersonSet SET cPerson = a.AAA --SELECT * FROM OutPzPersonSet d INNER JOIN AAAA a ON d.cz ...