calender oppgave- får ikke til å legge til tekst [
Besvar ]
Av: vedderHei! Jeg tar et kurs i asp.net, og der har jeg fått i oppgave å lage en kalender-kontroll der jeg skal kunne skrive noe inn i kalenderen og dette skal legges i sessionvariabler, slik at man skal kunne klikke på en dato, skrive inn noe - og deretter gå tilbake til datoen man skrev inn noe og så skal man da få frem teksten i valgte datorute i kalenderen.
Kan noen hjelpe meg med denne oppgaven så blir jeg meget glad. helst med kodeeksempler - Legger ved koden min så langt under -
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register tagprefix="prefix" tagname="usercontrol2" src="App_Data/WebUserControl2.ascx" %>
<%@ Import Namespace="System.Web.UI.WebControls.DayRenderEventArgs" %>
<!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">
<script language="VB" runat="server">
Public Sub Session_Start(ByVal Sender As Object, ByVal E As EventArgs)
Session("input") = Txtbx1.Text
Session("dato") = Calendar1.SelectedDate
Lblut.Text = Session("input")
End Sub
</script>
<title>Leksjon_5</title>
</head>
<body bgcolor=black>
<form id="form1" enableviewstate="true" runat="server">
<left>
<asp:Label ID="lbltut" EnableViewState="true" BackColor="yellow" runat="server" Height="15px" Width="40px"></asp:Label>
</left>
<div>
<center>
<asp:Calendar ID="Calendar1" BackColor="#FFFFCC" SelectionMode="Day" UseAccessibleHeader="true" runat="server" Width="508px" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="203px" ShowGridLines="True">
<TodayDayStyle BackColor="#FFCC66" BorderColor="Cyan" BorderStyle="Dotted" ForeColor="White" HorizontalAlign="Center" />
<DayStyle BorderColor="Navy" BorderStyle="Dotted" Font-Names="Algerian" Font-Size="Medium" />
<WeekendDayStyle BorderColor="Black" />
<NextPrevStyle BorderColor="Yellow" BorderStyle="Double" Font-Names="Algerian" ForeColor="#FFFFCC" Font-Size="9pt" />
<DayHeaderStyle BackColor="#FFCC66" BorderColor="#0000C0" BorderStyle="Double" Font-Bold="True" Font-Names="Bookman Old Style" Font-Size="Large" Height="1px"/>
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle Wrap="true" BackColor="#FFCC66" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
</asp:Calendar>
</center>
<center>
</center>
<center>
</center>
<center>
</center>
<asp:Repeater ID="Repeater1" runat="server">
</asp:Repeater>
<asp:Label ID="Lbloverskrift" BackColor="Yellow" runat="server" Text="<h3><center>Skriv inn dine gjøremål:</center></h3>" Height="25px" Width="254px"></asp:Label><center>
<asp:TextBox ID="Txtbx1" EnableViewState="true" BackColor=YellowGreen runat="server" AutoPostBack="true" OnTextChanged="Session_Start" Height="25px" Width="604px" ></asp:TextBox> <br /><br />
<asp:Label ID="Lblut" EnableViewState="true" BackColor="Goldenrod" runat="server" Height="68px" Width="495px"></asp:Label>
</center>
</div>
<p>
</p>
<center>
<prefix:usercontrol2 runat="server"/>
</center>
</form>
</body>
</html>