zoukankan      html  css  js  c++  java
  • Coolite handler调用用户控件里的方法

    如果是调用用户自定义控件里的方法,方式和母版页相差不大,不同的是UserControl需要设置别名才能成功调用。如下示例:

    代码
    using System;    
    using System.Collections.Generic;    
    using System.Linq;    
    using System.Web;    
    using System.Web.UI;    
    using System.Web.UI.WebControls;    
    using Coolite.Ext.Web;    
       
    [AjaxMethodProxyID(IDMode
    =AjaxMethodProxyIDMode.Alias,Alias="UC")]    
    public partial class uc : System.Web.UI.UserControl    
    {    
        
    protected void Page_Load(object sender, EventArgs e)    
        {    
       
        }    
       
        [AjaxMethod]    
        
    public string UserControlMethod()    
        {    
            
    return "我调用了用户控件里面的方法:UserControlMethod()";    
        }    
    }   
    <uc1:uc ID="uc1" runat="server" />    
       
    <ext:Button ID="Button2" runat="server" Text="点我吧">    
        
    <Listeners>        
        
    <Click Handler="      
             Coolite.AjaxMethods.UC.UserControlMethod({      
                 success: function(result) {      
                     Ext.Msg.alert(
    '提示信息', result);      
                 }      
             });
    " />        
        </Listeners>        
    </ext:Button>   
  • 相关阅读:
    Count the Colors---zoj1610线段树
    统计难题---hdu1251字典树模板
    Mayor's posters---poj2528线段树、离散化
    I Hate It---hdu1754线段树
    敌兵布阵---hud1166(线段树或者树状数组模板)
    A Simple Problem with Integers---poj3468线段树
    STL的Vector介绍
    STL的Deque介绍
    索尼高清影视技术学院参观观后感
    RTSP协议学习笔记
  • 原文地址:https://www.cnblogs.com/KingStar/p/1771395.html
Copyright © 2011-2022 走看看