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
warp and masterpage
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.

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, i have no problem and the WARP wotks perfectly. But if i use a master page, the warp does not work.

Have you any idea?

 

Thank you in advance.

  • 28407
    posted

    HI,

      I could not reproduce your issue. I created a Master page - Content page had usercontrol with a chart and button.  I ran the application and it worked as expected. 

     here is my master page:

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="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 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>

    Here my page:

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>

    <%@ Register assembly="Infragistics2.WebUI.Misc.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>

    <%@ Register src="WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server"
            Height="320px" Width="380px">
            <uc1:WebUserControl ID="WebUserControl1" runat="server" />
        </igmisc:WebAsyncRefreshPanel>
    </asp:Content>

    Here is my user control

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
    <%@ Register assembly="Infragistics2.WebUI.UltraWebChart.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebChart" tagprefix="igchart" %>
    <%@ Register assembly="Infragistics2.WebUI.UltraWebChart.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.UltraChart.Resources.Appearance" tagprefix="igchartprop" %>
    <%@ Register assembly="Infragistics2.WebUI.UltraWebChart.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.UltraChart.Data" tagprefix="igchartdata" %>
    <igchart:UltraChart ID="UltraChart1" runat="server" BackgroundImageFileName=""
        BorderColor="Black" BorderWidth="0px"
        EmptyChartText="Data Not Available. Please call UltraChart.Data.DataBind() after setting valid Data.DataSource"
        Version="9.1">
        <colormodel alphalevel="150" colorbegin="Pink" colorend="DarkRed"
            modelstyle="CustomLinear">
        </colormodel>
        <axis>
            <pe elementtype="None" fill="Cornsilk" />
            <x linethickness="1" tickmarkinterval="0" tickmarkstyle="Smart" visible="True">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Near"
                    itemformatstring="&lt;ITEM_LABEL&gt;" orientation="VerticalLeftFacing"
                    verticalalign="Center">
                    <serieslabels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Center"
                        orientation="Horizontal" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </x>
            <y linethickness="1" tickmarkinterval="10" tickmarkstyle="Smart" visible="True">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Far"
                    itemformatstring="&lt;DATA_VALUE:00.##&gt;" orientation="Horizontal"
                    verticalalign="Center">
                    <serieslabels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Center"
                        orientation="VerticalLeftFacing" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </y>
            <y2 linethickness="1" tickmarkinterval="10" tickmarkstyle="Smart"
                visible="False">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Near"
                    itemformatstring="&lt;DATA_VALUE:00.##&gt;" orientation="Horizontal"
                    verticalalign="Center" visible="False">
                    <serieslabels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Center"
                        orientation="VerticalLeftFacing" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </y2>
            <x2 linethickness="1" tickmarkinterval="0" tickmarkstyle="Smart"
                visible="False">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Far"
                    itemformatstring="&lt;ITEM_LABEL&gt;" orientation="VerticalLeftFacing"
                    verticalalign="Center" visible="False">
                    <serieslabels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Center"
                        orientation="Horizontal" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </x2>
            <z linethickness="1" tickmarkinterval="0" tickmarkstyle="Smart" visible="False">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Near"
                    itemformatstring="" orientation="Horizontal" verticalalign="Center">
                    <serieslabels font="Verdana, 7pt" fontcolor="DimGray" horizontalalign="Center"
                        orientation="Horizontal" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </z>
            <z2 linethickness="1" tickmarkinterval="0" tickmarkstyle="Smart"
                visible="False">
                <majorgridlines alphalevel="255" color="Gainsboro" drawstyle="Dot"
                    thickness="1" visible="True" />
                <minorgridlines alphalevel="255" color="LightGray" drawstyle="Dot"
                    thickness="1" visible="False" />
                <labels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Near"
                    itemformatstring="" orientation="Horizontal" verticalalign="Center"
                    visible="False">
                    <serieslabels font="Verdana, 7pt" fontcolor="Gray" horizontalalign="Center"
                        orientation="Horizontal" verticalalign="Center">
                        <layout behavior="Auto">
                        </layout>
                    </serieslabels>
                    <layout behavior="Auto">
                    </layout>
                </labels>
            </z2>
        </axis>
        <effects>
            <effects>
                <igchartprop:GradientEffect />
            </effects>
        </effects>
        <border thickness="0" />
        <tooltips font-bold="False" font-italic="False" font-overline="False"
            font-strikeout="False" font-underline="False" />
    </igchart:UltraChart>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click1"
        Text="Add Data" />


    Here is my usercontrol code-behind.

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Infragistics.UltraChart.Shared.Styles;
    using Infragistics.UltraChart.Resources.Appearance;
    using Infragistics.UltraChart.Core.Layers;

    public partial class WebUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UltraChart1.DataSource = GetData();
                UltraChart1.DataBind();
                UltraChart1.Axis.Y.RangeMax = 6;
                UltraChart1.Axis.Y.RangeMin = 0;
                UltraChart1.Axis.Y.RangeType = AxisRangeType.Custom;
            }
        }
        protected void Button1_Click1(object sender, EventArgs e)
        {
            UltraChart1.DataSource = GetDatax();
            UltraChart1.DataBind();
            UltraChart1.Axis.Y.RangeMax = 6;
            UltraChart1.Axis.Y.RangeMin = 0;
            UltraChart1.Axis.Y.RangeType = AxisRangeType.Custom;
        }

        private static DataTable GetData()
        {
            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 });
            return table;
        }
        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;
        }
       
    }