I just use queryString ("image") to keep generated chart in the middle panel
with top menu and bottom table when user select different chart varibale like
Unit on the dropdownlist button and enter date on the textbox. The top panel
is menu including dropdownlist button, textbox and submit button, the bottom
panel is reference table called gvReference. When page is load, it shows
menu, chart and reference table. Then when user select different chart
variable like Unit and enter Date in the textbox and hit Submit, there are 2
situations, one is if use queryString ("image") condition in the
Button_click sub, it always show the old chart with menu and table (that
means notuse new variable to draw chart), second is if no queryString
("image") condition, it shows only updated chart ( use new selected
vaaibels to draw chart), but lost mean and reference table. So I want to
keep top menu and table in the bottom and let new generated chart in the
middle panel. In general, what I want is when user select varibles and hit
submit, I want use new vabile to drawLineChart and display on the middle
panel without losting top menu and table in the bottom. I spend long time
and still get problem soloved, any suggestion and any new approach. Thanks
so much in advance.
1.CemsChart.aspx page for image part
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CemsChart.aspx.vb"
Inherits="CemsChart"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Cems Charting</title>
<meta http-equiv ="refresh" content= "300" />
</HEAD>
<body >
<form id="Form1" method="post" runat="server">
<asp:Panel ID="Panel1" runat="server" Height="44px" Width="986px">
<asp:Label ID="Label2" runat="server" Text="Select Unit: " Font-Bold="True"
Font-Size="Small"></asp:Label>
<asp:DropDownList ID="dplstUnit" runat="server" Width="141px">
</asp:DropDownList>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Select Date:
"></asp:Label>
<asp:textbox id="tbDate" runat="server" Width="81px"></asp:textbox>
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Height="506px" Width="1100px">
<asp:Image ID="Image3" runat="server"
Width="1000px" Height="500px" AlternateText="Cems Chart" ImageAlign="Middle"
ImageUrl="CemsChart.aspx?image=1">
</asp:Image>
</asp:Panel>
<asp:Panel ID="Panel3" runat="server" Height="98px" Width="1000px">
Reference Data
<asp:GridView ID="gvReference" runat="server" CaptionAlign="Top"
CellSpacing="1" >
</asp:GridView>
</asp:Panel>
</form>
</body>
</HTML>
---------------------------------------------------------------------------------
2. CemsChart.aspx.vb
Imports System.Drawing
Imports System.Drawing.Text
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Data.SqlClient
Public Class CemsChart Inherits System.Web.UI.Page
Public strDate As String
Public strFilename As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
tbDate.Text = Today
'End If
If Not IsPostBack Then
strDate = tbDate.Text
End If 'end postback
'.'*** call menuTable ****
Call PopulateListTable()
strFilename = dplstUnit.SelectedValue
If Request.QueryString("image") = 1 Then 'second postback to call ?
Call DrawLineChart(strDate, strFileName)
End If
End Sub
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
strDate = tbDate.Text
'**** call PopulateListTable******************************
Call PopulateListTable()
If Request.QueryString("image") = 1 Then
Call DrawLineChart(strDate, strFilename)
End If
End Sub
Public Sub PopulateListTable() 'pupulate dplstUnit downloadlist and
gvRefeence table
//code here
End Sub
Public Sub DrawLineChart(ByVal title As String, ByVal subTitle As String,
ByVal width As Integer, ByVal height As Integer, ByRef dt As DataTable, ByVal
timeP As Integer, ByRef
target As Stream)
// code here
End sub