Sep 23, 2011, 7:02 AM
[CLOSED] Problem with DirectMethod and ActiveX (MS Chart)
Master Page:
Code Behind: This works but the size of the chart is hardcoded (represented by 1000 and 700)
Question:
(1) Does this mean that DirectMethod cannot change the controls in the client?
(2) This page is a UserControl and part of a bigger page, can you advice a way for me to reload, if needed, this whole UserControl into the existing Ext.Panel?
<%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<script type="text/javascript">
var ResizeChart = function(panel){
var h = panel.getBody().getViewSize().height;
var w = panel.getBody().getViewSize().width;
Ext.net.DirectMethods.UC_TrendingChart.DM_ResizeChart(w,h);
}
</script>
<ext:Panel ID="Panel1" runat="server" Border="false" ButtonAlign="Right">
<Content>
<asp:Chart ID="Chart1" runat="server" Height="300px" Width="600px" EnableViewState="true"></asp:Chart>
</Content>
</ext:Panel>
Code Behind: This works but the size of the chart is hardcoded (represented by 1000 and 700)
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
ShowChart(1000, 700); //This creates the MS chart ActiveX
}
}
Code Behind: My objective is for the first load to call a javascript to run and get the rendered panel size, then use DirectMethod to load the ActiveX with the panel size. But somehow, this fails to render. protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
X.Js.Call("ResizeChart", new JRawValue(this.Panel1.ClientID));
}
}
[DirectMethod(ShowMask = true, Msg = "Resizing Chart...")]
public void DM_ResizeChart(int width, int height)
{
ShowChart(width, height); //This creates the MS chart ActiveX
}
My goal is to load the activex chart everytime the button is clicked, wherein the chart will change depending on given parameters.Question:
(1) Does this mean that DirectMethod cannot change the controls in the client?
(2) This page is a UserControl and part of a bigger page, can you advice a way for me to reload, if needed, this whole UserControl into the existing Ext.Panel?
Last edited by Daniil; Sep 26, 2011 at 7:56 AM.
Reason: [CLOSED]