473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calendar Help in ASP.NET 2.0

Hello,

I have a calendar and a textbox right below it on my webpage. I need
help with creating some code to display information about the date the
user clicked in the text box below it.

For example, they clock on August 13th, and in texbox1, it will say
"Wedding, 2:00 PM".

How do I get started?

Thanks,
Brian

Sep 14 '06 #1
3 3121
Hi Brian,

I'm not sure what you need to accomplish, but you seem to need to look up
additional information based on the date. Perhaps you can provide more info?

In the meantime, I've pasted in a little code that might get you started
towards something....

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Calendar1_Selec tionChanged _
(ByVal sender As Object, ByVal e As System.EventArg s)
TextBox1.Text = _
GetAdditionalDa ta(Calendar1.Se lectedDate)
End Sub

Function GetAdditionalDa ta _
(ByVal selDate As DateTime) As String
If selDate.DayOfWe ek = DayOfWeek.Satur day Or _
selDate.DayOfWe ek = DayOfWeek.Sunda y Then
Return "Weekend Date: " & _
selDate.ToLongD ateString
Else
Return "Week day Date: " & _
selDate.ToLongD ateString
End If
End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calend ar Value in a Textbox</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
onselectionchan ged="Calendar1_ SelectionChange d"></asp:calendar>
<br />
<asp:textbox id="TextBox1" runat="server"
width="300px"></asp:textbox>&nb sp;</div>
</form>
</body>
</html>

<br**********@g mail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
Hello,

I have a calendar and a textbox right below it on my webpage. I need
help with creating some code to display information about the date the
user clicked in the text box below it.

For example, they clock on August 13th, and in texbox1, it will say
"Wedding, 2:00 PM".

How do I get started?

Thanks,
Brian

Sep 15 '06 #2
I hope this is clearer:

I have a calendar on my page with a textbox below it. When a user
clicks on a date, I want to be able to show events for that day in the
textbox below the calendar.

For example, they click on September 21st, I want it to display
information for events of that day in the textbox below. And maybe even
appear as a tooltip?

I will look at your code too but what I stated above is my goal.

Ken Cox [Microsoft MVP] wrote:
Hi Brian,

I'm not sure what you need to accomplish, but you seem to need to look up
additional information based on the date. Perhaps you can provide more info?

In the meantime, I've pasted in a little code that might get you started
towards something....

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Calendar1_Selec tionChanged _
(ByVal sender As Object, ByVal e As System.EventArg s)
TextBox1.Text = _
GetAdditionalDa ta(Calendar1.Se lectedDate)
End Sub

Function GetAdditionalDa ta _
(ByVal selDate As DateTime) As String
If selDate.DayOfWe ek = DayOfWeek.Satur day Or _
selDate.DayOfWe ek = DayOfWeek.Sunda y Then
Return "Weekend Date: " & _
selDate.ToLongD ateString
Else
Return "Week day Date: " & _
selDate.ToLongD ateString
End If
End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calend ar Value in a Textbox</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
onselectionchan ged="Calendar1_ SelectionChange d"></asp:calendar>
<br />
<asp:textbox id="TextBox1" runat="server"
width="300px"></asp:textbox>&nb sp;</div>
</form>
</body>
</html>

<br**********@g mail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
Hello,

I have a calendar and a textbox right below it on my webpage. I need
help with creating some code to display information about the date the
user clicked in the text box below it.

For example, they clock on August 13th, and in texbox1, it will say
"Wedding, 2:00 PM".

How do I get started?

Thanks,
Brian
Sep 15 '06 #3
If you're looking for hooking up events to a database, to show in the
calendar - - here's a code sample from ASPNet101.com that might help:
http://aspnet101.com/aspnet101/aspne...code=caltitles

there are others - just search in the website for 'calendar'

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

<br**********@g mail.comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
I hope this is clearer:

I have a calendar on my page with a textbox below it. When a user
clicks on a date, I want to be able to show events for that day in the
textbox below the calendar.

For example, they click on September 21st, I want it to display
information for events of that day in the textbox below. And maybe even
appear as a tooltip?

I will look at your code too but what I stated above is my goal.

Ken Cox [Microsoft MVP] wrote:
Hi Brian,

I'm not sure what you need to accomplish, but you seem to need to look
up
additional information based on the date. Perhaps you can provide more
info?

In the meantime, I've pasted in a little code that might get you started
towards something....

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Calendar1_Selec tionChanged _
(ByVal sender As Object, ByVal e As System.EventArg s)
TextBox1.Text = _
GetAdditionalDa ta(Calendar1.Se lectedDate)
End Sub

Function GetAdditionalDa ta _
(ByVal selDate As DateTime) As String
If selDate.DayOfWe ek = DayOfWeek.Satur day Or _
selDate.DayOfWe ek = DayOfWeek.Sunda y Then
Return "Weekend Date: " & _
selDate.ToLongD ateString
Else
Return "Week day Date: " & _
selDate.ToLongD ateString
End If
End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calend ar Value in a Textbox</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
onselectionchan ged="Calendar1_ SelectionChange d"></asp:calendar>
<br />
<asp:textbox id="TextBox1" runat="server"
width="300px"></asp:textbox>&nb sp;</div>
</form>
</body>
</html>

<br**********@g mail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
Hello,
>
I have a calendar and a textbox right below it on my webpage. I need
help with creating some code to display information about the date the
user clicked in the text box below it.
>
For example, they clock on August 13th, and in texbox1, it will say
"Wedding, 2:00 PM".
>
How do I get started?
>
Thanks,
Brian
>

Sep 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2092
by: Sugapablo | last post by:
Can someone recommend a very simple script to produce a web calendar? I just want something where I can select a month and year and it produces a very basic HTML table, 7 columns across, one month at a time, with the dates filled in. No frills, no nothing, just pure, month producing code. --
2
14882
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format CCYYMMDD. Sounds easy enough, right?? I am attempting to accomplish this by creating a GregorianCalender which will get me the week of year. Then by changing the day of week to 1 (start of week) i'm trying the get the first day of the week,...
2
3417
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
0
1720
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar" OnClientClick= "window.open('Calendar.aspx', 'Calendar', 'menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, width=200, height=200');" />
1
2735
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar" OnClientClick= "window.open('Calendar.aspx', 'Calendar', 'menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, width=200, height=200');" />
0
2016
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error: 'this.container' is null or not an object
3
2743
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can assist with this. Thanks in advance. I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000.
0
3327
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I would like to get the code for connecting the javascript to asp.net page... Please help me... The javascript code is as follows..
4
3357
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
1
3711
by: abhishekbrave | last post by:
The code below is opening a calendar on mouse over in the same window. I need the calendar to be opened in new window. Have to fulfill this requirement urgentely so posting the whole code here. I tried doing some workaround using window.open() but not getting the calendar in new window. <html> <head> <script language="JavaScript">
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.