Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
909
WEbChart Usercontrol in a WARP
posted

Hello,

1-I have a master page,

2-I have a user control for a webChart.

I want to use WARP in my page.

In my page, I have a button and when i click on it, new data will be generated for the webchart user control.

If i use the warp in a webForm page (without masterpage), the WARP wotks perfectly. But if i use the master page, the warp does not work.

Have you any idea?

 

Thank you in advance.

 

Parents
  • 28496
    Offline posted

    can you explain in more detail what you mean when you say it does not work?

  • 909
    posted in reply to David Negley

    I mean, the page do post back.

     

    Thank you in advance.

     

    Here is my code.

     

    *************master page********

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="WARP.MasterPage" %>

    <!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 id="Head1" runat="server">
        <title>Untitled Page</title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server" Text="Master page"></asp:Label>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
           
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    ***************************************

     

    ***************usercontrol****************** 

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl2.ascx.cs" Inherits="WARP.WebUserControl2" %>
    <%@ Register Assembly="Infragistics2.WebUI.UltraWebChart.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.UltraWebChart" TagPrefix="igchart" %>
    <%@ Register Assembly="Infragistics2.WebUI.UltraWebChart.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.UltraChart.Resources.Appearance" TagPrefix="igchartprop" %>
    <%@ Register Assembly="Infragistics2.WebUI.UltraWebChart.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.UltraChart.Data" TagPrefix="igchartdata" %>
    <igchart:ultrachart id="UltraChart1" runat="server" backgroundimagefilename="" bordercolor="Black"
        borderwidth="1px" emptycharttext="Data Not Available. Please call UltraChart.Data.DataBind() after setting valid Data.DataSource"
        version="8.3">
    <ColorModel ModelStyle="CustomLinear" ColorBegin="Pink" ColorEnd="DarkRed" AlphaLevel="150"></ColorModel>

    <Effects><Effects>
    <igchartprop:GradientEffect></igchartprop:GradientEffect>
    </Effects>
    </Effects>

    <Axis>
    <PE ElementType="None" Fill="Cornsilk"></PE>

    <X Visible="True" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="0">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="&lt;ITEM_LABEL&gt;" Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" VerticalAlign="Center" Orientation="VerticalLeftFacing">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="Horizontal">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </X>

    <Y Visible="True" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="50">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="&lt;DATA_VALUE:00.##&gt;" Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Far" VerticalAlign="Center" Orientation="Horizontal">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="VerticalLeftFacing">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </Y>

    <Y2 Visible="False" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="50">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="&lt;DATA_VALUE:00.##&gt;" Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="VerticalLeftFacing">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </Y2>

    <X2 Visible="False" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="0">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="&lt;ITEM_LABEL&gt;" Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Far" VerticalAlign="Center" Orientation="VerticalLeftFacing">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="Horizontal">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </X2>

    <Z Visible="False" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="0">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="" Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal">
    <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="Horizontal">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </Z>

    <Z2 Visible="False" LineThickness="1" TickmarkStyle="Smart" TickmarkInterval="0">
    <MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>

    <MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>

    <Labels ItemFormatString="" Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal">
    <SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Center" VerticalAlign="Center" Orientation="Horizontal">
    <Layout Behavior="Auto"></Layout>
    </SeriesLabels>

    <Layout Behavior="Auto"></Layout>
    </Labels>
    </Z2>
    </Axis>
    </igchart:ultrachart>

    ***********************************************

     

    **********************page**************************


    <%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WARP.WebForm2" Title="Untitled Page" %>

    <%@ Register Src="WebUserControl2.ascx" TagName="WebUserControl2" TagPrefix="uc2" %>

    <%@ Register Assembly="Infragistics2.WebUI.Misc.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.Misc" TagPrefix="igmisc" %>
    <%@ Register Src="WebUserControl1.ascx" TagName="WebUserControl1" TagPrefix="uc1" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        &nbsp;
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
        <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Height="269px"
            Width="340px">
            &nbsp;
            <uc2:WebUserControl2 ID="WebUserControl2_1" runat="server" />
        </igmisc:WebAsyncRefreshPanel>
        <br />
        <br />
        &nbsp;
    </asp:Content>
    /////////////////////////////////////////////////////////////

    ********code behind******

            protected void Button1_Click(object sender, EventArgs e)
            {

                WebUserControl2_1.UltraChart1.DataSource = GetDatax();
                WebUserControl2_1.UltraChart1.DataBind();
                WebUserControl2_1.UltraChart1.Axis.Y.RangeMax = 6;
                WebUserControl2_1.UltraChart1.Axis.Y.RangeMin = 0;
                //WebUserControl2_1.UltraChart1.Axis.Y.RangeType = AxisRangeType.Custom;
            }

           
            private static DataTable GetDatax()
            {
                DataTable table = new DataTable();
                table.Columns.Add("Label Column", typeof(string));
                table.Columns.Add("Sales", typeof(double));
                table.Columns.Add("Presales", typeof(double));
                table.Rows.Add(new object[] { "Point A", 1.0, 3.0 });
                table.Rows.Add(new object[] { "Point B", 2.0, 2.0 });
                table.Rows.Add(new object[] { "Point C", 3.0, 1.0 });
                table.Rows.Add(new object[] { "Point D", 4.0, 2.0 });
                table.Rows.Add(new object[] { "Point E", 5.0, 3.0 });
                table.Rows.Add(new object[] { "Point F", 6.0, 4.0 });
                return table;
            }

    ************************************************

    ******************************************************

Reply Children
No Data