kabucek
Oct 30 2007, 10:29 AM
Hi ALL
I'm creating a website in frontpage 2003.
I want to create a calendar in one of my websites <Calendar>
I have installed IIS on my machines.
I've tried to go with those steps:
http://office.microsoft.com/en-us/frontpag...0429311033.aspxbut I can't get it to work.
Any help?
or another suggestions?
Thanks.
dubsdj
Oct 31 2007, 07:58 AM
if you know a bit of vb.net then this following example should get you started:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server">
DataSet ds = new DataSet();
protected void Page_Load(Object Src, EventArgs E)
{
string connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Server.MapPath("Database/events.mdb") +";";
string sql = "select * from tblevents";
OleDbDataAdapter da = new OleDbDataAdapter(sql, connectionstring);
da.Fill(ds, "tblevents");
}
protected void eventscalendar_DayRender(Object Src, DayRenderEventArgs E)
{
StringBuilder strEvents = new StringBuilder();
strEvents.Append("<span style=\"font-size:60%\">");
if (E.Day.IsOtherMonth)
E.Cell.Controls.Clear();
foreach (DataRow row in ds.Tables["tblevents"].Rows)
{
DateTime eventdate = (DateTime)row["startingdate"];
if (eventdate.Equals(E.Day.Date))
if (E.Day.IsOtherMonth)
strEvents.Append("<br />");
else
strEvents.Append("<br />" + row["eventtitle"]);
}
strEvents.Append("</span>");
E.Cell.Controls.Add(new LiteralControl(strEvents.ToString()));
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Event Calendar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body>
<form runat="server">
<span class="style1">
<asp:calendar DayStyle-HorizontalAlign="right" ID="eventcalendar" runat="server" backcolor="#FFFFCC" ShowGridLines="true" OnDayRender="eventscalendar_DayRender"></asp:calendar>
</span>
</form>
</body>
</html>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.