Cannot use recognise AjaxEvents

  1. #1

    Cannot use recognise AjaxEvents


    Code in my .aspx file
    
    
    
    <ext:Anchor>
    
    
    <ext:ComboBox StoreID = "storeChuyenDe" DisplayField = "Chuyende" ValueField = "IDChuyende" ID="cboKhuVuc" runat = "server" EmptyText = "Khu V?c" X= "100" Y = "5">
    
    
    <AjaxEvents>
    
    
    <Change OnEvent = "cboKhuVuc_Change"></Change>
    
    
    </AjaxEvents>
    
    
    </ext:ComboBox>
    
    
    </ext:Anchor>
    And this is my code in .aspx.vb
    
    
    
    [AjaxMethod]
    
    
    public void cboKhuVuc_Change()
    
    
    {
    
    
    int maKhuVuc = Convert.ToInt32(this.cboKhuVuc.SelectedItem.Value);
    
    
    BindcboNoiBanHanh(maKhuVuc);
    
    
    }

    The prolem is that when I build the website, VS display following error message:

    Error 1 No overload for 'cboKhuVuc_Change' matches delegate 'Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandl er' D:\MyProjects\QuanLyCongVan\Website\AddCongVan.asp x 74

    I try to change to other event as Select, CHange, but it still display error
    The same happen to other controls when call ajax events

    I guess I have to install something to read ajax from aspx file

    I am using VS.Net 2005

    Could anybody tell me how .... THANKS
  2. #2

    RE: Cannot use recognise AjaxEvents

    Anyone help me please, I think that is common issue
    I cannot catch event by AjaxEvents
    I have used this control VB.Net, and it work fine
    The problem I get when I change to user C# and VS2005
  3. #3

    RE: Cannot use recognise AjaxEvents

    I have found it, this maybe unsupported feature of Coolite
    I use Masterpage, and by searching on google I found that we have to add event in code for each controls when Page is Innited
    But now, I remove all and then use normal page, not MasterPage
  4. #4

    RE: Cannot use recognise AjaxEvents

    Hi,

    You should use the following...

    Example (.aspx)

    <ext:Anchor>
        <ext:ComboBox 
            ID="cboKhuVuc" 
            runat="server" 
            StoreID="storeChuyenDe" 
            DisplayField="Chuyende" 
            ValueField="IDChuyende" 
            EmptyText="Khu V?c" 
            X="100" 
            Y="5">
            <AjaxEvents>
                <Change OnEvent="cboKhuVuc_Change" />
            </AjaxEvents>
        </ext:ComboBox>
    </ext:Anchor>
    Example (.aspx.cs)

    public void cboKhuVuc_Change(object sender, AjaxEventArgs e)
    {
        int maKhuVuc = Convert.ToInt32(this.cboKhuVuc.SelectedItem.Value);
        BindcboNoiBanHanh(maKhuVuc);
    }
    Hope this helps.

    Geoffrey McGill
    Founder
  5. #5

    RE: Cannot use recognise AjaxEvents

    Oh, thank you geoffrey, I change the eventhandler to AjaxEventHandler, and it work well
    but it just work when I don't use FileField (I mean don't click on Browse button of FileField control).When click on btn Browse of FileField control, all other button cannot render to code behind
    These are my atual code on .aspx and aspx.cs. I have removed the masterpage
    Please have a look and help me. Thanks

    // Behind code
    
    
    
    using System;
    
    
    using System.Data;
    
    
    using System.Configuration;
    
    
    using System.Collections;
    
    
    using System.Web;
    
    
    using System.Web.Security;
    
    
    using System.Web.UI;
    
    
    using System.Web.UI.WebControls;
    
    
    using System.Web.UI.WebControls.WebParts;
    
    
    using System.Web.UI.HtmlControls;
    
    
    using Coolite.Ext.Web;
    
    
    using DataProvider;
    
    
    using DataProvider.Model;
    
    
    public partial class AddCongVan : System.Web.UI.Page
    
    
    {
    
    
    #region EventHandler
    
    
    protected void Page_Init(object sender, EventArgs e)
    
    
    {
    
    
    cboKhuVuc.AjaxEvents.Change.Event += new ComponentAjaxEvent.AjaxEventHandler(cboKhuVucChange);
    
    
    //btnLuu.AjaxEvents.Click.Event += new ComponentAjaxEvent.AjaxEventHandler(btnLuu_Click);
    
    
    }
    
    
    protected void Page_Load(object sender, EventArgs e)
    
    
    {
    
    
    
    
    
     
    
    
     
    
    
    if (Page.IsPostBack == false)
    
    
    {
    
    
    BindcboNoiBanHanh(1);
    
    
    BindcboLoaiVanBan();
    
    
    BindcboKhuVuc();
    
    
    BindchkUserGroup();
    
    
    BindmultiUser();
    
    
    BindcboLoaiChuyenDe();
    
    
    }
    
    
    }
    
    
    [AjaxMethod]
    
    
    public void cboKhuVucChange(object sender, AjaxEventArgs e)
    
    
    {
    
    
    int maKhuVuc = Convert.ToInt32(this.cboKhuVuc.SelectedItem.Value);
    
    
    BindcboNoiBanHanh(maKhuVuc);
    
    
    this.cboNoiBanHanh.Reset();
    
    
    }
    
    
    [AjaxMethod]
    
    
    public void btnLuu_Click(object sender, AjaxEventArgs e)
    
    
    {
    
    
    int khuVuc = Convert.ToInt32(cboKhuVuc.SelectedItem.Value);
    
    
    int noiBanHanh = Convert.ToInt32(cboNoiBanHanh.SelectedItem.Value);
    
    
    int loaiVanBan = Convert.ToInt32( cboLoaiVanBang.SelectedItem.Value);
    
    
    int loaiChuyenDe = Convert.ToInt32(cboLoaiChuyenDe.SelectedItem.Value);
    
    
    string soCongVan = txtSoCongVan.Text;
    
    
    DateTime ngayBanHanh = dtNgayBanHanh.SelectedDate;
    
    
    DateTime ngayHetHan = dtNgayHetHan.SelectedDate;
    
    
    String tencongvan = this.txtTenCongVan.Text;
    
    
    //Luu file 
    
    
    string strfilename = fileFieldTenFile.PostedFile.FileName;
    
    
    string fileExtension = strfilename.Substring(strfilename.LastIndexOf('.'));
    
    
    if (fileExtension != ".pdf")
    
    
    return;
    
    
    
    
    
    string path = System.Web.Configuration.WebConfigurationManager.AppSettings["pathfile"];
    
    
    CongVanController controller = new CongVanController();
    
    
    int maxID = controller.GetMaxID() + 1;
    
    
    fileFieldTenFile.PostedFile.SaveAs(path + Convert.ToString(maxID) + ".pdf");
    
    
    //Add Cong Van
    
    
    CongVan congvan = new CongVan();
    
    
    congvan.IDChuyenDe = khuVuc;
    
    
    congvan.IDLoaiVB = loaiVanBan;
    
    
    congvan.IDNoiBH = noiBanHanh;
    
    
    congvan.SoCongVan = soCongVan;
    
    
    congvan.NgayBanHanh = ngayBanHanh;
    
    
    congvan.NgayHetHieuLuc = ngayHetHan;
    
    
    congvan.TenCongVan = tencongvan;
    
    
    congvan.NgayCapNhat = DateTime.Now;
    
    
    congvan.TenFile = Convert.ToString(maxID + 1) + ".pdf";
    
    
    //congvan.UserUpdate = Convert.ToInt32(Session["UserLoginID"]);
    
    
    congvan.UserUpdate = 29;
    
    
    controller.Save(congvan);
    
    
    }
    
    
    #endregion
    
    
    
    
    
    #region Helper functions
    
    
    //UserGroup du?c load t? table Priv
    
    
    private void BindchkUserGroup()
    
    
    {
    
    
    PrivController controller = new PrivController();
    
    
    ArrayList prvCollection = controller.ListAll();
    
    
    Coolite.Ext.Web.Checkbox chk;
    
    
    foreach (Priv prv in prvCollection)
    
    
    {
    
    
    chk = new Coolite.Ext.Web.Checkbox();
    
    
    chk.BoxLabel = prv.Name;
    
    
    chk.Checked = false;
    
    
    chk.ID = "chkUserGroup" + prv.privID;
    
    
    this.chkUserGroup.Items.Add(chk);
    
    
    }
    
    
    }
    
    
    //User du?c load t? table User
    
    
    private void BindmultiUser()
    
    
    {
    
    
    UserController controller = new UserController();
    
    
    ArrayList prvCollection = controller.ListAll ();
    
    
    Coolite.Ext.Web.ListItem item;
    
    
    
    
    
    foreach (User user in prvCollection)
    
    
    {
    
    
    item = new Coolite.Ext.Web.ListItem(user.Name,Convert.ToString(user.Userid));
    
    
    
    
    
    //item. = user.Name;
    
    
    //item.Value = user.Userid;
    
    
    this.multiUser.Items.Add(item);
    
    
    }
    
    
    }
    
    
    // Khu v?c load t? Chuy?n Ð?
    
    
    private void BindcboKhuVuc()
    
    
    {
    
    
    ChuyenDeController controller = new ChuyenDeController();
    
    
    ArrayList chuyendeCollection = controller.ListAll();
    
    
    this.storeChuyenDe.DataSource = chuyendeCollection;
    
    
    this.storeChuyenDe.DataBind();
    
    
    }
    
    
    // Lo?i chuy?n d? load t? table DanhMuc
    
    
    private void BindcboLoaiChuyenDe()
    
    
    {
    
    
    DanhMucController controller = new DanhMucController();
    
    
    ArrayList danhmucCollection = controller.ListAll();
    
    
    this.storeDanhMuc.DataSource = danhmucCollection;
    
    
    this.storeDanhMuc.DataBind();
    
    
    }
    
    
    //Lo?i Van B?n load t? table LoaiVB
    
    
    private void BindcboLoaiVanBan()
    
    
    {
    
    
    LoaiVBController controller = new LoaiVBController();
    
    
    ArrayList loaiVBCollection = controller.ListAll();
    
    
    this.storeLoaiVanBan.DataSource = loaiVBCollection;
    
    
    this.storeLoaiVanBan.DataBind();
    
    
    }
    
    
    //Noi ban h?nh load t? table NoiBanHanh d?a v?o di?u ki?n ch?n c?a Khu v?c
    
    
    private void BindcboNoiBanHanh(int maKhuVuc)
    
    
    {
    
    
    int idChuyenDe = maKhuVuc;
    
    
    NoiBanHanhController controller = new NoiBanHanhController();
    
    
    ArrayList noiBanHanhCollection = controller.ListByChuyenDe (idChuyenDe);
    
    
    this.storeNoiBanHanh.DataSource = noiBanHanhCollection;
    
    
    this.storeNoiBanHanh.DataBind();
    
    
    //cboNoiBanHanh.AddEvents("cboNoiBanHanh.AddEvents.Change");
    
    
    this.cboNoiBanHanh.SelectedItem.Text =" ";
    
    
    }
    
    
    #endregion
    
    
    }
    //Code on .Aspx file
    
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <html>
    
    
    <HEAD>
    
    
    <title>Cong van</title>
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    
    
    <LINK href="css/cv.css" type="text/css" rel="stylesheet"/>
    
    
    </HEAD>
    
    
    
    
    
    <body>
    
    
    <form id="Form1" method="post" runat="server">
    
    
    <ext:ScriptManager ID="ScriptManager1" runat="server">
    
    
    </ext:ScriptManager>
    
    
    <ext:Panel ID="ViewPort1" runat="server" Height = "1200">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout7" runat = "server">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel9" runat = "server" X= "5" Y = "5" Height = "90" Width = "1200">
    
    
    <Body>
    
    
    
    
    
    <ext:Label ID="Label14" Text = "Put your image here" runat = "server"></ext:Label>
    
    
    
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel10" runat = "server" Height = "30" X = "5" Y = "95" Width = "1200">
    
    
    <Body>
    
    
    <asp:Menu ID="mainMenu" runat="server" Font-Size="Smaller" Orientation="Horizontal"
    
    
    Width="100%">
    
    
    <Items>
    
    
    <asp:MenuItem Text="Ð?i password" Value="DoiPassword"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Noi ban h?nh" Value="NoiBanHanh"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Khu v?c" Value="KhuVuc"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Lo?i van b?n" Value="LoaiVanBan"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Chuy&amp;#234;n d?" Value="ChuyenDe"></asp:MenuItem>
    
    
    <asp:MenuItem Text="C&amp;#244;ng van" Value="CongVan"></asp:MenuItem>
    
    
    <asp:MenuItem Text="T&amp;#236;m ki?m" Value="TimKiem"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Ngu?i d&amp;#249;ng" Value="NguoiDung"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Qu?n tr?" Value="QuanTri"></asp:MenuItem>
    
    
    <asp:MenuItem Text="Logout" Value="Logout"></asp:MenuItem>
    
    
    </Items>
    
    
    </asp:Menu>
    
    
    
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel11" runat = "server" Height = "1000" X= "5" Y = "130" Width = "1200">
    
    
    <Body>
    
    
    <script language = "javascript" type = "text/javascript">
    
    
    function AddUser()
    
    
    {
    
    
    var multiUserSelectedItem = <%=multiUser.ClientID%>.getSelectedIndexes();
    
    
    }
    
    
    function RemoveUser()
    
    
    {
    
    
    }
    
    
    </script>
    
    
    <ext:Store runat="server" ID = "storeNoiBanHanh">
    
    
    <Reader>
    
    
    <ext:JsonReader ReaderID="IDNoiBH">
    
    
    <Fields>
    
    
    <ext:RecordField Name="IDNoiBH" />
    
    
    <ext:RecordField Name="NoiBH" />
    
    
    </Fields>
    
    
    </ext:JsonReader>
    
    
    </Reader>
    
    
    </ext:Store>
    
    
    <ext:Store runat="server" ID = "storeLoaiVanBan">
    
    
    <Reader>
    
    
    <ext:JsonReader ReaderID="IDLoaiVB">
    
    
    <Fields>
    
    
    <ext:RecordField Name="IDLoaiVB" />
    
    
    <ext:RecordField Name="LoaiVB" />
    
    
    </Fields>
    
    
    </ext:JsonReader>
    
    
    </Reader>
    
    
    </ext:Store>
    
    
    <ext:Store runat="server" ID = "storeDanhMuc">
    
    
    <Reader>
    
    
    <ext:JsonReader ReaderID="IDDanhMuc">
    
    
    <Fields>
    
    
    <ext:RecordField Name="IDDanhMuc" />
    
    
    <ext:RecordField Name="TenDanhMuc" />
    
    
    </Fields>
    
    
    </ext:JsonReader>
    
    
    </Reader>
    
    
    </ext:Store>
    
    
    <ext:Store runat="server" ID = "storeChuyenDe">
    
    
    <Reader>
    
    
    <ext:JsonReader ReaderID="IDChuyende">
    
    
    <Fields>
    
    
    <ext:RecordField Name="IDChuyende" />
    
    
    <ext:RecordField Name="Chuyende" />
    
    
    </Fields>
    
    
    </ext:JsonReader>
    
    
    </Reader>
    
    
    </ext:Store>
    
    
    <ext:AbsoluteLayout runat = "server">
    
    
    <Anchors>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label1" runat = "server" Text = "Th?m C?ng Van" X = "580" Y = "10"
    
    
    StyleSpec ="font-size: 14px;color: #336699; text-align:center;font-weight:bold;font-family: Verdana">
    
    
    </ext:Label>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel1" runat = "server" X= "300" Y = "40" Height = "70" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout2" runat = "server" Height = "100">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label2" runat = "server" Text = "Khu v?c" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:ComboBox StoreID = "storeChuyenDe" DisplayField = "Chuyende" ValueField = "IDChuyende" ID="cboKhuVuc" runat = "server" EmptyText = "Khu V?c" X= "100" Y = "5">
    
    
    <AjaxEvents>
    
    
    <Change OnEvent = "cboKhuVucChange"></Change>
    
    
    </AjaxEvents>
    
    
    </ext:ComboBox>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label3" runat = "server" Text = "Lo?i van b?n" X= "5" Y = "40"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:ComboBox DisplayField = "LoaiVB" ValueField = "IDLoaiVB" StoreID = "storeLoaiVanBan" ID ="cboLoaiVanBang" runat = "server" EmptyText = "Lo?i Van B?n" X= "100" Y = "40"></ext:ComboBox>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label4" runat = "server" Text = "Noi ban h?nh" X= "330" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:ComboBox DisplayField = "NoiBH" ValueField = "IDNoiBH" StoreID = "storeNoiBanHanh" ID="cboNoiBanHanh" runat = "server" EmptyText = "Noi Ban H?nh" X= "425" Y = "5"></ext:ComboBox>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label5" runat = "server" Text = "Lo?i Chuy?n d?" X= "330" Y = "40"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:ComboBox StoreID = "storeDanhMuc" DisplayField = "TenDanhMuc" ValueField = "IDDanhMuc" ID="cboLoaiChuyenDe" runat = "server" EmptyText = "Lo?i Chuy?n Ð?" X= "425" Y = "40"></ext:ComboBox>
    
    
    </ext:Anchor>
    
    
    
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    </Body>
    
    
    
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel2" runat = "server" X= "300" Y = "120" Height = "70" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout3" runat = "server" Height = "100">
    
    
    <Anchors>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label6" runat = "server" Text = "S? C?ng Van" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:TextField ID="txtSoCongVan" runat = "server" X= "100" Y = "5" Text = "S? C?ng Van"></ext:TextField>
    
    
    </ext:Anchor>
    
    
    
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label7" runat = "server" Text = "Ng?y ban h?nh" X= "330" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:DateField Width = "160" ID="dtNgayBanHanh" runat = "server" EmptyText = "Ng?y Ban H?nh" X= "425" Y = "5"></ext:DateField>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label8" runat = "server" Text = "Ng?y h?t h?n" X= "330" Y = "40"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:DateField Width = "160" ID="dtNgayHetHan" runat = "server" EmptyText = "Ng?y h?t h?n" X= "425" Y = "40"></ext:DateField>
    
    
    </ext:Anchor>
    
    
    
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    </Body>
    
    
    
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel3" runat = "server" X= "300" Y = "200" Height = "40" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout4" runat = "server" Height = "100">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label9" runat = "server" Text = "T?n C?ng Van" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:TextField ID="txtTenCongVan" runat = "server" X= "100" Y = "5" Width = "485" Text = "T?n C?ng Van"></ext:TextField>
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel7" runat = "server" X= "300" Y = "250" Height = "40" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout6" runat = "server" Height = "100">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label13" runat = "server" Text = "T?n File" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:FileUploadField ID="fileFieldTenFile" runat = "server" X= "100" Y = "5" Width = "485" Text = "T?n File" Enabled = "true"></ext:FileUploadField>
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label12" runat = "server" Text = "Ð?i tu?ng nh?n" X= "580" Y = "300" StyleSpec ="font-size: 14px;color: #336699; text-align:center;font-weight:bold;font-family: Verdana" ></ext:Label>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel4" runat = "server" Height = "150" X= "300" Y= "330" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout5" runat = "server">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label10" runat = "server" Text = "Nh¢m user" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:CheckboxGroup runat = "server" ID = "chkUserGroup" X="100" Y = "5" ColumnsNumber = "2" Width = "450">
    
    
    </ext:CheckboxGroup>
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel5" runat = "server" Height = "120" X= "300" Y= "490" Width = "800">
    
    
    <Body>
    
    
    <ext:AbsoluteLayout ID="AbsoluteLayout1" runat = "server">
    
    
    <Anchors>
    
    
    <ext:Anchor>
    
    
    <ext:Label ID="Label11" runat = "server" Text = "User" X= "5" Y = "5"></ext:Label>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:MultiSelect runat = "server" ID = "multiUser" X="100" Y = "5" Width = "230">
    
    
    </ext:MultiSelect>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Panel runat = "server" X= "340" Y = "15" Width = "35" Height = "25"> 
    
    
    <Body> 
    
    
    <ext:Button ID = "btnAddUser" runat = "server" Text = ">">
    
    
    <Listeners>
    
    
    <Click Fn = "AddUser"/>
    
    
    </Listeners>
    
    
    </ext:Button>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel6" runat = "server" X= "340" Y = "70" Width = "35" Height = "25"> 
    
    
    <Body> 
    
    
    <ext:Button ID="btnRemoveUser" runat = "server" Text = "<">
    
    
    <Listeners>
    
    
    <Click Fn = "RemoveUser"/>
    
    
    </Listeners>
    
    
    </ext:Button>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:MultiSelect runat = "server" ID = "multiSelectedUser" X="385" Y = "5" Width = "230">
    
    
    
    
    
    </ext:MultiSelect>
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor>
    
    
    <ext:Panel ID="Panel8" runat = "server" ButtonAlign = "Left" X= "300" Y = "620" Height = "35" >
    
    
    <Body>
    
    
    <ext:Button ID = "btnLuu" runat = "server" Text = "Luu">
    
    
    <AjaxEvents>
    
    
    <Click OnEvent = "btnLuu_Click"></Click>
    
    
    </AjaxEvents>
    
    
    </ext:Button>
    
    
    <ext:Button ID ="btnHuy" runat = "server" Text = "H?y"></ext:Button>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    
    
    
    </ext:AbsoluteLayout>
    
    
    
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    
    
    
    </ext:Anchor>
    
    
    </Anchors>
    
    
    </ext:AbsoluteLayout>
    
    
    </Body>
    
    
    </ext:Panel>
    
    
    </form>
    
    
    </body>
    
    
    </HTML>
  6. #6

    RE: Cannot use recognise AjaxEvents

    Hi,

    I get an Exception when I try to run your sample. Is all that code required to reproduce the problem? Can you make a very simple sample which only demonstrates the minimum amount of code required to reproduce the problem.


    Also, the following example may help in solving the problem, see


    https://examples1.ext.net/#/Form/FileUploadField/Basic/


    Geoffrey McGill
    Founder
  7. #7

    RE: Cannot use recognise AjaxEvents

    Hi Geoffrey, thanks so much for your reply

    This is my test code with FileUploadField and it didnot run well
    this is my make up code
    
    
    
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!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 runat="server">
    
    
    <title>Untitled Page</title>
    
    
    </head>
    
    
    <body>
    
    
    <ext:ScriptManager ID="ScriptManager1" runat="server">
    
    
    </ext:ScriptManager>
    
    
    <form id="form1" runat="server">
    
    
    
    
    
    <ext:FileUploadField ID="FileUploadField1" runat="server">
    
    
    </ext:FileUploadField>
    
    
    <ext:Button ID="Button1" runat="server" Text="Submit">
    
    
    <AjaxEvents>
    
    
    <Click OnEvent = "Button1_Click"></Click>
    
    
    </AjaxEvents>
    
    
    </ext:Button>
    
    
    </form>
    
    
    </body>
    
    
    </html>
    and this is my code behid

    
    
    
    Imports Coolite.Ext.Web
    
    
    Partial Class _Default
    
    
    Inherits System.Web.UI.Page
    
    
    <AjaxMethod()> _
    
    
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As AjaxEventArgs)
    
    
    Dim filename As String
    
    
    filename = Me.FileUploadField1.PostedFile.FileName
    
    
    End Sub
    
    
    End Class
    and this is my webconfig
    
    
    
    <?xml version="1.0"?>
    
    
    <configuration>
    
    
    <appSettings/>
    
    
    <connectionStrings/>
    
    
    <system.web>
    
    
    <compilation debug="true" strict="false" explicit="true">
    
    
    <assemblies>
    
    
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
    
    
    <pages>
    
    
    <namespaces>
    
    
    <clear/>
    
    
    <add namespace="System"/>
    
    
    <add namespace="System.Collections"/>
    
    
    <add namespace="System.Collections.Specialized"/>
    
    
    <add namespace="System.Configuration"/>
    
    
    <add namespace="System.Text"/>
    
    
    <add namespace="System.Text.RegularExpressions"/>
    
    
    <add namespace="System.Web"/>
    
    
    <add namespace="System.Web.Caching"/>
    
    
    <add namespace="System.Web.SessionState"/>
    
    
    <add namespace="System.Web.Security"/>
    
    
    <add namespace="System.Web.Profile"/>
    
    
    <add namespace="System.Web.UI"/>
    
    
    <add namespace="System.Web.UI.WebControls"/>
    
    
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    
    
    <add namespace="System.Web.UI.HtmlControls"/>
    
    
    </namespaces>
    
    
    </pages>
    
    
    
    
    
    <authentication mode="Windows"/>
    
    
    httpModules>
    
    
    <add name="AjaxRequestModule" type="Coolite.Ext.Web.AjaxRequestModule, Coolite.Ext.Web" />
    
    
    </httpModules>
    
    
    </system.web>
    
    
    </configuration>
  8. #8

    RE: Cannot use recognise AjaxEvents

    I have found that, errors displayed when I upload big file,
    I try to use another smaller, it work well
  9. #9

    RE: Cannot use recognise AjaxEvents

    Hi,

    You can extend the timeout by adding the following node inside the <system.web> node of your web.config.


    Example


    <httpRuntime maxRequestLength="524290" executionTimeout="1800" />

    Adjust the maxRequestLength value to meet your requirements.


    Hope this helps.


    Geoffrey McGill
    Founder

Similar Threads

  1. AjaxEvents
    By qch2006qch in forum 1.x Help
    Replies: 1
    Last Post: Apr 11, 2012, 12:16 PM
  2. Replies: 1
    Last Post: Apr 26, 2011, 6:49 PM
  3. Error Ajaxevents
    By Maia in forum 1.x Help
    Replies: 5
    Last Post: Dec 24, 2009, 9:26 AM
  4. Ext.Msg before AjaxEvents
    By fquintero in forum 1.x Help
    Replies: 2
    Last Post: Aug 10, 2009, 1:44 PM
  5. AjaxEvents in Portal
    By Ronald in forum 1.x Help
    Replies: 0
    Last Post: Oct 24, 2008, 12:13 PM

Posting Permissions