Hi Michael,
This is the entire code:
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack){
MakeChartPage();
}
}
private void MakeChartPage()
{
string DatVandaag;
DateTime dt = DateTime.Now;
if ((int)dt.DayOfWeek != 5)
{
switch ((int)dt.DayOfWeek)
{
case 0:
DatVandaag=DateTime.Today.AddDays(-2).ToString("dd/MM/yyyy");
break;
case 1:
DatVandaag=DateTime.Today.AddDays(-3).ToString("dd/MM/yyyy");
break;
case 2:
DatVandaag=DateTime.Today.AddDays(-4).ToString("dd/MM/yyyy");
break;
case 3:
DatVandaag=DateTime.Today.AddDays(-5).ToString("dd/MM/yyyy");
break;
case 4:
DatVandaag=DateTime.Today.AddDays(-6).ToString("dd/MM/yyyy");
break;
case 6:
DatVandaag=DateTime.Today.AddDays(-1).ToString("dd/MM/yyyy");
break;
}
}
else
{
DatVandaag=DateTime.Today.ToString("dd/MM/yyyy");
}
switch (Request.QueryString.Get("type"))
{
case "w":
cd.DocumentSource=".\\xml\\wchart.xml";
cd.TransformSource=".\\stylesheet\\wchart.xsl";
LiteralHeat.Text = "<center><H5>Wekelijkse vinyl TOP 10
("+DatVandaag+")</center></H5><br><br>";
LiteralChart.Text = "Elke week vind je hier mijn vinyl TOP 10.<br>Deze TOP
10 is samengesteld uit vinyls die ik zelf bezit.<br>";
break;
case "a":
cd.DocumentSource=".\\xml\\achart.xml";
cd.TransformSource=".\\stylesheet\\achart.xsl";
LiteralHeat.Text = "<center><H5>Vinyl TOP 10
allertijden</center></H5><br><br>";
LiteralChart.Text = "Hier zijn ze dan, volgens mijn persoonlijke menig de
beste vinyls.<br>"+
"De meeste tracks komen uit de jaren '90. Zelf vind ik dat er toen in die
"+
" tijd songs van veel betere kwaliteit gemaakt werden.<br>";
break;
}
}
--
http://www.djberniev.be
Michael Earls said:
I get the feeling you're not showing us all the code. Can you paste the
entire method? It looks like you might have the DatVandaag variable
declared outside of a "using" or "try" block. You'll need to define the
variable in the same "scope" that you use it.