473,471 Members | 4,625 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HELP!! calendar within a usercontrol....

Hi,

I have a calendar control within a usercontrol. The calendar is to be used
on serveral pages of a web site - hence the use of a usercontrol.

I now wish to grab the value of Calendar_SelectionChanged and display in a
label on the main aspx page.

I thought I would be able to do this by having a Public Property within the
code behind for the usercontrol as follows :

Public Property ConcertDate() As String

Get

Return calConcerts.SelectedDate.ToString("dd/MM/yyyy")

End Get

Set(ByVal Value As String)

End Set

End Property


Then within the code behind for the main page I would have the follwoing key
lines of code :

Protected WithEvents ctrlCalendar As MyCalendarUserControl ' declare the
usercontrol

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

' get a reference to the ctrlCalendar user control.

ctrlCalendar = DirectCast(FindControl("ctrlCalendar"),
MyCalendarUserControl)

End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

lblConcertDate.Text = "Concert Date : " & ctrlCalendar.ConcertDate

End Sub


When I do this the selected date updates to the correct date following 2
clicks - it is one click behind!

I've read I may need to use event bubbling but being a beginner I do not
know whether this is the right way to go.

Please help.

Jul 21 '05 #1
0 992

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

Similar topics

3
by: addi | last post by:
All, I will be eternally greatful if someone can provide snippet of code, URL or reference material that shows how to display data in a "n colums * n rows" format. I am new to ASP and have...
2
by: Nicole - ASP/C# Beginner | last post by:
I am trying to kick off an custom event in a usercontrol that the webpage will listen and preform some actions if the event is fired from within my usercontrol
2
by: Mihaela Barbu via DotNetMonster.com | last post by:
I added the HelpButton on a form that contains UserControls and it just doesn't work. If I go with the mouse cursor over a windows form control (button, listView, etc) everything works just fain....
1
by: ann | last post by:
is there someway to disable the Other Months day(the previous and next months days) s from appearing? If so, can you let me know how? Thanks so much for your help!
5
by: Mark Friedman | last post by:
Does anyone know how to reference a subcontrol of a UserControl within client-side script. For example, if I have a TextBox as one of the elements of my UserControl with an id of "MyTextBox", how...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
0
by: Gamze | last post by:
Hi, I have a calendar control within a usercontrol. The calendar is to be used on serveral pages of a web site - hence the use of a usercontrol. I now wish to grab the value of...
2
BenRatcliffe
by: BenRatcliffe | last post by:
Hi there, Has anyone got any idea how i can use details in entered into a form (and stored in a tale) to create a meeting in the outlook calendar. I have tried linking the calendar to the database...
1
by: phpmel | last post by:
Hi guys, I have an asp calendar control, text box, calendar icon, eraser icon all within an update panel. The calendar works fine, postbacks are handled without the flickering of the screen etc....
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.