Click here to Skip to main content
15,902,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I am developing a web page in which i want to display on a popup on linkbutton click.
I want to display chart dynamically in ModalPopup .but i am unable to display it

directly on linkbutton click.

When i click on the link button , the buttonclick event should get fired and

on button click event the the function is called to get the datafor chart.

Once that data is recieved I create the chart dynamically and then call the

modalpopup.show() but no contents are visible on the chart .How can i solve this ?

Please suggest...

please see the below code..

ASP.NET
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
      <contenttemplate>
       <asp:Panel ID="pnlPopup" runat="server" Width="550px">
       <table>
       <tr>
       <td class="popupheading" align="right">
           <input ID="btnCancel" type="button" value="Cancel" /></td>
       </tr>
       <tr>
       <td>
       
       
     <asp:chart ID="Chart1" runat="server" backcolor="#F3DFC1" 
            BackGradientStyle="TopBottom" BorderColor="181, 64, 1" BorderDashStyle="Solid" 
            BorderWidth="2" Height="351px" 
            ImageLocation="~\TempImages\ChartPic_#SEQ(300,3)" imagetype="Png" 
            Palette="BrightPastel" Width="500px">
            <titles>
                <asp:title Alignment="TopLeft" Font="Trebuchet MS, 14.25pt, style=Bold" 
                    ForeColor="26, 59, 105" ShadowColor="32, 0, 0, 0" ShadowOffset="3" >               
            </titles>
            <legends>
                <asp:legend BackColor="Transparent" 
                    Font="Trebuchet MS, 8pt, style=Bold" Name="Default" AutoFitMinFontSize="9" 
                    BackImageAlignment="Top" BackImageTransparentColor="255, 128, 128" 
                    BorderColor="192, 64, 0" BorderDashStyle="NotSet" 
                    InterlacedRowsColor="255, 128, 128" BackImageWrapMode="Unscaled" 
                    Enabled="False">
                
            </legends>
            <borderskin skinstyle="Emboss" />
            <series>
                <asp:series BorderColor="180, 26, 59, 105" ChartArea="ChartArea1" 
                    Color="224, 64, 10" Name="Series1" IsValueShownAsLabel="True" 
                    Label="#VALY % " LabelToolTip="#VAL" ToolTip="#VAL" 
                    CustomProperties="MinPixelPointWidth=30, DrawingStyle=Cylinder, LabelStyle=Top, MaxPixelPointWidth=30, DrawSideBySide=False">
                
            </series>
            <chartareas>
                <asp:chartarea BackColor="OldLace" BackGradientStyle="TopBottom" 
                    BackSecondaryColor="White" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" 
                    Name="ChartArea1" ShadowColor="Transparent">
                    <area3dstyle Inclination="15" IsClustered="False" IsRightAngleAxes="False" 
                        perspective="10" Rotation="10" wallwidth="0" />
                    <axisy linecolor="64, 64, 64, 64" islabelautofit="False">
                        <labelstyle font="Trebuchet MS, 8.25pt, style=Bold" />
                        <majorgrid linecolor="64, 64, 64, 64" />
		<majortickmark interval="Auto" intervaltype="Auto" intervaloffset="Auto" intervaloffsettype="Auto" />
                    </axisy>
                    <axisx linecolor="64, 64, 64, 64" labelautofitmaxfontsize="12">
                        TitleAlignment="Near">
                        <labelstyle font="Trebuchet MS, 8.25pt, style=Bold" IsStaggered="True" />
                        <majorgrid linecolor="64, 64, 64, 64" />
                        <scaleview sizetype="Months" />
                    </axisx>
                
            </chartareas>
        
      </td>
       </tr>
       </table>
         <div>
            <asp:Button ID="btnOkay" Text="Done" runat="server" onclick="btnOkay_Click" />
             </div>
        
          <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
              onclick="LinkButton1_Click" OnClientClick="GetChartData">Click here
          <cc1:ModalPopupExtender ID="modalpopup"  runat="server" 
              BackgroundCssClass="modal" CancelControlID="btnCancel" DynamicServicePath="" 
              Enabled="True" OkControlID="Button1" PopupControlID="pnlPopup" 
              TargetControlID="LinkButton1" DynamicServiceMethod="GetDynamicContent">
          
        <br />
        </contenttemplate>




Regards,
Kishor.
Posted
Updated 27-Feb-12 15:40pm
v2
Comments
ZurdoDev 27-Feb-12 8:51am    
Are you sure it is an issue with the modal popup? You didn't provide any code on how you are databinding your chart. It is possible you didn't databind your chart properly and that is why you are not setting anything.
praveen41 9-Jun-14 8:15am    
I am also having the same issue,i have a page with a chart,when i tried to open it directly in a browser,charts are loading. But when i called that page as a popup,charts are not loading

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900