JS Event Trigger Event

Source: Internet
Author: User

 <tr> <td colspan= "6" class= "Text_color" > <asp:textbox runat= "ser Ver "id=" txtquery "width=" 20% "></asp:TextBox>    <asp:dropdownlist id=" D Dlreportinstance "runat=" Server "></asp:DropDownList>    <asp:button Runa                                t= "Server" id= "Btnquery" cssclass= "Formbutton" text= "search" onclick= "Btnquery_click"/>                           <a href= "#" onclick= "Showquery ()" > Advanced query </a>       Page display number of bars settings     <asp:dropdownlist id= "Seletpagenum" Run at= "Server" ></asp:DropDownList> </td> </tr> &LT;TR&G                    T                      &LT;TD colspan= "6" > <asp:updatepanel runat= "Server" id= "UpdatePanel2" >      <ContentTemplate> <soa:deluxegrid id= "Dgdatasource" runat= "Server" DATASOURC Eid= "DataSource" allowsorting= "true" onsorting= "dgdatasource_sorting" pagesize= ". Aut" ogeneratecolumns= "False" datasourcemaxrow= "0" allowpaging= "True" cssclass= "DataList"                                        Width= "100%" onrowdatabound= "Dgdatasource_rowdatabound" ><%--<Columns>                                            <asp:templatefield headertext= "Operation" visible= "false" sortexpression= "" >                                                    <ItemTemplate> <div> <asp:linkbutton runat= "Server" id= "Btnedit" > Edit </asp:LinkButton>     <asp:linkbutton runat= "Server" id= "Btndel" > Delete </as        P:linkbutton>                                        </div> </ItemTemplate>                                    </asp:TemplateField> </Columns>--%> 

If this is the case, the controls on the platform do not support

<asp:dropdownlist id= "Seletpagenum" runat= "Server" autopostback= "true" ></asp:DropDownList>

The drop-down box triggers the query button click event, which controls the page's Long value.

<script type= "Text/javascript" >   $ ("#seletPageNum"). Change (function () {        document.getElementById (" Btnquery "). Click ();    }) </script>

        protected void Datasource_selecting (object sender, ObjectDataSourceSelectingEventArgs e) {Dgdat            Asource.pagesize = Convert.ToInt32 (Seletpagenum.selectedvalue);                if (E.executingselectcount = = False) {e.inputparameters["tempid"] = template.id;                Wheresqlclausebuilder where = new Wheresqlclausebuilder ();                list<keyandvalue> dataitems = new list<keyandvalue> (); if (!hfquerystr.value.isnullorempty ()) Dataitems = Jsonserializerexecute.deserialize<list<keyandv                Alue>> (Hfquerystr.value); foreach (var item in dataitems) {var parameter = Template.Config.DataQuery.SearchParame Ters. Find (p = p.parametername = = Item.                    Key); if (parameter! = null) where. Appenditem (item. Key, TSqlBuilder.Instance.CheckUnicodeQuotationMark (item. Value), "", parameter. FormatString, True); } if (!txtquery.text.isnullorempty ()) {//"normal search" if (Template.Config.DataQ Uery. Defaultwhereclause.contains ("=") = = True) where.                    Appenditem (Template.Config.DataQuery.DefaultWhereClause.TrimEnd (' = '), txtquery.text); else where.                Appenditem (Template.Config.DataQuery.DefaultWhereClause, "%" + txtquery.text + "%", "like"); } if (!string.                    IsNullOrEmpty (Template.defaultvalue)) {//No value for querying all time data if (Template.isdefault)                            {if (!ddlreportinstance.selectedvalue.isnullorempty ()) {//"normal search" if (DdlReportInstance.Items.Count > 0) where.                        Appenditem (Reporttimename, DdlReportInstance.SelectedItem.Text);     }} else {                   where.                    Appenditem (Reporttimename, DataFormTemplateQueryDataAdapter.Instance.GetReportTimeName (Template.defaultvalue));            }} this.datasource.Condition = where; }        }

        protected void Btnquery_click (object sender, EventArgs e)        {            this.dgDataSource.DataBind ();        }

JS Event Trigger Event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.