A problem AjaxMethod and AjaxEvent

  1. #1

    A problem AjaxMethod and AjaxEvent

    hi

    I want to load a graphic. the question is : i place my function in the page_load and works great. i want to do the same with a button but it doesn´t modify the graphic i did it with Microsoft Ajax and placed the button into an update panel and updated it. Is there something similar for Coolite or a property because i did it with and AjaxMethod and AjaxEvent and didn´t modify the chart.

    [AjaxMethod]
    public void LoadData()
    {
      //these are the params for the linear graphic
      double[] yval1 = { 15, 24, 38, 4, 59 };
      string[] xval1 = { "john", "Mary", "Ralph", "Betty", "Morphy" };
      Chart1.Series["Series1"].Points.DataBindXY(xval1, yval1);
    }
    Aspx code for tha AjaxMethod:

    <ext:Button ID="Button1" runat="server" Text="Carga Encuesta" Icon="Accept">
     <Listeners>
      <Click Handler="Coolite.AjaxMethods.LoadData();" />
     </Listeners>
    </ext:Button>

    
    public void LoadData()
    {
      //these are the params for the linear graphic
      double[] yval1 = { 15, 24, 38, 4, 59 };
      string[] xval1 = { "john", "Mary", "Ralph", "Betty", "Morphy" };
      Chart1.Series["Series1"].Points.DataBindXY(xval1, yval1);
    }

    
    <ext:Button ID="Button1" runat="server" Text="Accept" Icon="Accept">
     <AjaxEvents>
       <Click OnEvent="Button1_Click">
         <EventMask ShowMask="true" MinDelay="300" Msg="Loading..."   />
       </Click>
     </AjaxEvents>
    </ext:Button>
  2. #2

    RE: A problem AjaxMethod and AjaxEvent

    Hi,

    MS Graph render as image therefore you can't update it during ajax event.
    I can suggest next solution:


    1. Define MS Grap control in different page and set for it *RenderType="BinaryStreaming", It should be single control on page
    ***<%@ Page Language="C#" %>
    ** <asp:Chart id="Chart1" runat="server"*
    ** * * *RenderType="BinaryStreaming"
    ** * * * * ....


    2. Add to page image tag
    ** **<img id="chart" />


    3. For update image use the following function
    ** * * *var reloadImage = function() {
    ** * * * * *Ext.fly('chart').dom.src = String.format('getImage.aspx/?t={0}', new Date().format('U'));

    ** * * *}
    t - query string parameter which allows to avoid caching








  3. #3

    RE: A problem AjaxMethod and AjaxEvent

    Thanks it works but i wanna do the same too with a Dundas Chart http://www.dundas.com/ it sent a weird code maybe it comes from the image i don´t know maybe i´m doing something wrong i did exactly you recommended


    <DCWC:Chart ID="Chart1" runat="server" RenderType="BinaryStreaming" >
    <Series>
    <DCWC:Series Name="Default_AutoRunWizard"></DCWC:Series>
    </Series>
    <ChartAreas>
    <DCWC:ChartArea Name="Default"></DCWC:ChartArea>
    </ChartAreas>
    </DCWC:Chart>

Similar Threads

  1. Problem with AjaxMethod and prototype
    By glenh in forum 1.x Help
    Replies: 4
    Last Post: Aug 24, 2009, 11:13 AM
  2. [CLOSED] AjaxEvent vs AjaxMethod
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 29, 2009, 5:52 PM
  3. [CLOSED] Load Coolite controls from AjaxEvent or AjaxMethod
    By pumpkin in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 02, 2009, 11:02 PM
  4. Different between AjaxEvent and AjaxMethod?
    By dbassett74 in forum 1.x Help
    Replies: 0
    Last Post: Apr 23, 2009, 10:17 PM
  5. [CLOSED] AjaxMethod problem
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 30, 2009, 7:06 AM

Posting Permissions