CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 10/11/2003 11:17:05 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 53 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
new2ASPnet
Asp.Net User
Cant Raise Event10/11/2003 11:17:05 AM

0/0

I am planning to update my datepicker, bcoz i already recieve couple of emails asking for update and documentation of this control. But as of now i am having problem raising an event. The code below is the main class for my control, if somebody here could diagnos this class why it does'nt raise the SelectedDateChanged event i would greatly appreciate that.

Thats in advance.


Imports System
Imports System.ComponentModel
Imports System.Configuration
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports IGERSoft.WebControls

Namespace IGERSoft.WebControls

' Use the Datepicker control to create a web control that behaves like MS DateTimePicker OCX.
' The Size property specifices the width of the text box in number of characters, much like the HtmlInputText control.
' If the size is not set, the width of the control will be the default width of HtmlInputText.
' The Datepicker Control implements databiding. The DataSource property specifies the data source to bind to.

<DefaultProperty("Text"), ToolboxData("<{0}:Datepicker runat=server></{0}:Datepicker>")> Public Class Datepicker
Inherits HtmlContainerControl
Implements IPostBackDataHandler

' The SelectedDateChanged event is raised when the value of Datepicker control
' Change between posts to the server.
Public Event SelectedDateChanged As EventHandler

#Region "Private Members"

Private EventServerChange As Object
Private _size As Integer = 20
Private _datasource As Object = Nothing
Private _text As String = String.Empty

#End Region

#Region "Public Properties"

Public Property Text() As String
Get
Return _text
End Get

Set(ByVal Value As String)
_text = Value
End Set
End Property

' This property is not supported for this control.
Public Overrides Property InnerText() As String
Get
Throw New NotSupportedException("'Datepicker' does not support the InnerText property.")
End Get
Set(ByVal Value As String)
Throw New NotSupportedException("'Datepicker' does not support the InnerText property.")
End Set
End Property

' This property is not supported for this control.
Public Overrides Property InnerHtml() As String
Get
Throw New NotSupportedException("'Datepicker' does not support the InnerHTML property.")
End Get
Set(ByVal Value As String)
Throw New NotSupportedException("'Datepicker' does not support the InnerHTML property.")
End Set
End Property

' Gets or sets the width size of the text field.
Public Property Size() As Integer
Get
Return _size
End Get
Set(ByVal Value As Integer)
_size = Value
Me.Attributes("size") = _size.ToString()
End Set
End Property

' Gets or sets a value indicating whether an automatic postback to the server
' will occur whenever the user changes the selected index.
Public Property AutoPostBack() As Boolean
Get
Dim obj As Object = ViewState("AutoPostBack")
Return IIf(obj Is Nothing, False, CBool(obj))
End Get
Set(ByVal Value As Boolean)
ViewState("AutoPostBack") = Value
End Set
End Property

' Gets or sets the source of information to bind to the Datepicker control.
Public Property DataSource() As Object
Get
Return _datasource
End Get
Set(ByVal Value As Object)
If Not IsDate(Value) Then
Throw New ArgumentException("An invalid data source is being used for " + MyBase.ID + ". A valid data source must be of type date. ")
End If
_datasource = Value
End Set
End Property

#End Region

#Region "Public Constants"

' The namespace for the Datepicker.
Public Const TagNamespace As String = "IGER"

' The Datepicker's tag name.
Public Const DatepickerTagName As String = "Datepicker"

' The Datepicker default client location
Public Const DefaultCommonFilesRoot As String = "/webctrl_client/igersoft/"

#End Region

#Region "Internal Properties"

ReadOnly Property RenderedNameAttribute() As String
Get
Return Me.UniqueID
End Get
End Property

#End Region

#Region "Render Methods"

Private Sub Datepicker_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
If Not MyBase.Page Is Nothing Then
MyBase.Page.RegisterRequiresPostBack(Me)
End If
End Sub

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Me.RenderBeginTag(writer)
Me.RenderChildren(writer)
Me.RenderEndTag(writer)
End Sub

Protected Overrides Sub RenderBeginTag(ByVal writer As System.Web.UI.HtmlTextWriter)
writer.Write("<?XML:NAMESPACE PREFIX=""" & TagNamespace & """ />")
writer.WriteLine()
writer.Write("<?IMPORT NAMESPACE=""" & TagNamespace & """ IMPLEMENTATION=""" & _
Me.GetFilePath() & "datepicker.htc" & """ />")
writer.WriteLine()
writer.WriteBeginTag(TagNamespace + ":" + DatepickerTagName)
Me.RenderAttributes(writer)
writer.Write(">")
End Sub

Protected Overrides Sub RenderAttributes(ByVal writer As System.Web.UI.HtmlTextWriter)
If Not MyBase.ID Is Nothing Then
writer.WriteAttribute("id", MyBase.ClientID)
writer.WriteAttribute("name", Me.UniqueID)
End If

If Me.AutoPostBack Then
Dim strOnChangeCmd As String = Me.Attributes("onselecteddatechanged")

If Not strOnChangeCmd Is Nothing Then
Me.Attributes("onselecteddatechanged") = IIf(strOnChangeCmd.EndsWith(";"), strOnChangeCmd + Page.GetPostBackEventReference(Me, String.Empty) + ";", strOnChangeCmd + ";" + Page.GetPostBackEventReference(Me, String.Empty))
Else
Me.Attributes.Add("onselecteddatechanged", Page.GetPostBackEventReference(Me, String.Empty))
End If
End If

Dim strWidth As String = Me.Attributes("width")
Dim strFirstDayOfWeek As String = Me.Attributes("FirstDayOfWeek")
Dim strDaynameLetters As String = Me.Attributes("daynameLetters")
Dim strDaynamesShort As String = Me.Attributes("daynamesShort")
Dim strDaynamesLong As String = Me.Attributes("daynamesLong")
Dim strMonthnamesShort As String = Me.Attributes("monthnamesShort")
Dim strMonthnamesLong As String = Me.Attributes("monthnamesLong")
Dim strFormat As String = Me.Attributes("format")
Dim strImageLocation As String = Me.GetFilePath() & "dpickerimages/"

If Not strWidth Is Nothing Then
writer.WriteAttribute("width", strWidth)
End If

If Not strFormat Is Nothing Then
writer.WriteAttribute("format", strFormat)
End If

' Set value
If Not Me.Text Is Nothing Then
If Me.Text.Length > 0 Then
writer.WriteAttribute("value", Me.Text)
End If
End If

' Image Loaction
writer.WriteAttribute("ImageLocation", strImageLocation)

Me.Attributes.Render(writer)
End Sub

Protected Overrides Sub RenderEndTag(ByVal writer As System.Web.UI.HtmlTextWriter)
writer.WriteEndTag(TagNamespace + ":" + DatepickerTagName)
End Sub

#End Region

#Region "Post Back Data and Event Handler"

Public Function LoadPostData(ByVal postDataKey As String, ByVal postCollection As System.Collections.Specialized.NameValueCollection) As Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData
Dim presentValue As String = Me.Text
Dim postedValue As String = postCollection(postDataKey)
If Not presentValue.Equals(postedValue) Then
Me.Text = postedValue
Return True
End If
Return False
End Function

Public Sub RaisePostDataChangedEvent() Implements System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent
Me.OnSelectedDateChanged(EventArgs.Empty)
End Sub

Protected Overrides Sub LoadViewState(ByVal savedState As Object)
If Not savedState Is Nothing Then
Me.Text = savedState
End If
End Sub

Protected Overrides Function SaveViewState() As Object
Dim savedState = New Object()
savedState = Me.Text
Return savedState
End Function

#End Region

#Region "Selected Date Changed Event Handler"

' Invokes delegates registered with the change event.
Protected Overridable Sub OnSelectedDateChanged(ByVal e As EventArgs)
RaiseEvent SelectedDateChanged(Me, e)
End Sub

#End Region

#Region "Private Methods"

Private Function GetFilePath() As String
' Look at the current configuration for the path
Dim strFilePath As String = ConfigurationSettings.AppSettings("IGERWEBCONTORLS_COMMONFILEPATH")
If Not strFilePath Is Nothing Then
If strFilePath.Length > 0 Then
If Right(strFilePath, strFilePath.Length - 1) <> "/" Then
strFilePath &= "/"
End If
End If
Return strFilePath
End If

Return DefaultCommonFilesRoot
End Function

#End Region

End Class
End Namespace

The most wasted day is that in which we have not laughed.

V i r g i l R e b o t o n
joteke
Asp.Net User
Re: Cant Raise Event10/11/2003 1:46:30 PM

0/0

Does the postback data get loaded i.e LoadPostData called?
Thanks,

Teemu Keiski
Finland, EU
new2ASPnet
Asp.Net User
Re: Cant Raise Event10/12/2003 8:36:34 AM

0/0

May be it does, because the text property value changes which is only change in LoadPostData event. But im not sure because my debuger does'nt stop in that event when i insert a breakpoint.

Any Idea?
The most wasted day is that in which we have not laughed.

V i r g i l R e b o t o n
joteke
Asp.Net User
Re: Cant Raise Event10/12/2003 9:15:47 AM

0/0

So you mean it doesn't stop at call for OnSelectedDateChanged ?
Thanks,

Teemu Keiski
Finland, EU
new2ASPnet
Asp.Net User
Re: Cant Raise Event10/14/2003 1:13:22 PM

0/0

Yes... in my PC...

But still i am not sure bcoz sometime my debugger is giving me hardtime, it does'nt hit breakpoints.

Would you want me to send you all the files including the project so u can further diagnos it?
The most wasted day is that in which we have not laughed.

V i r g i l R e b o t o n
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
VB & VBA in a Nutshell: The Language Authors: Lomax, Pages: 633, Published: 1998
Every Tenant's Legal Guide Authors: Janet Portman, Marcia Stewart, Pages: 447, Published: 2007
Eco-wars: Political Campaigns and Social Movements Authors: Ronald T. Libby, Pages: 254, Published: 1998
The Campaign Manager: Running and Winning Local Elections Authors: Catherine Shaw, Pages: 399, Published: 2004
Event: A Novel Authors: David Lynn Golemon, Pages: 502, Published: 2007
Programming C#: Building .NET Applications with C# Authors: Jesse Liberty, Pages: 644, Published: 2005
A Study of Spinoza's Ethics Authors: Jonathan Francis Bennett, Jonathan Bennett, Pages: 406, Published: 1984
The Washington Lobby Authors: Congressional Quarterly, inc, Pages: 179, Published: 1982

Web:
[#JBSEAM-3046] Can't @RaiseEvent from EntityHome.setInstance ... If one overrides setInstance() in an entityHome subclass in order to raise an event when the instance changes: @Name("dateRangeHome") public class ...
Derived classes cannot raise base class events An event can be raised only from the declaration space in which it is declared. Therefore, a class cannot raise events from any other class, even one from ...
Help Cannot raise events in my web service - Visual Basic .NET Forums Writing Service for moving files in folder service is starting but cannot raise event heres my code can any 1 suggest how do i raise ...
.NET interop can't raise events from ATL control in C# app in VS ... can't raise events from ATL control in C# app in VS 2005 debugger - nic. 22-May- 07 12:45:49. Hi, I am seeing problems raising events in a C# app that is ...
Derived classes cannot raise base class events - Xtreme .NET Talk Derived classes cannot raise base class events General. ... Raising events in Derived classes, kejpa, General, 1, 06-18-2004 02:08 PM ...
Cannot Raise Event - VBForums Hyperactive Member. Join Date: Feb 01. Location: Houston, TX. Posts: 327. MagellanTX is on a distinguished road (10+). Unhappy Cannot Raise Event ...
DotNetJunkies :: The #1 .NET Community for Developers Along with microsoft states clearly that you cannot raise a click event programically. The easiest way to do it is to define a separate ...
RaiseEvent - .NET C# nullability (no one listening) of the Click event before raising it. This helps derived classes to raise click event themeselves as they cannot raise ...
Events - New Object-Oriented Capabilities in VB.NET ... Derived classes cannot raise base class events in VB.Net. ... NET cannot directly raise events in base classes from a derived class, there is an easy ...
RaiseEvent Statement You cannot use RaiseEvent to raise events that are not explicitly declared in the module. For example, if a form has a Click event, you cannot raise its ...

Videos:
The Ernestina - An event to raise funds The Ernestina is an old Cape Verdean fishing vessel that was given to New Bedford 25 years ago. The Feds and Massachusetts can't seem to find the nec...
DANCE KYLIE TRIBUTE @ cancer fund raising event ITALY 2007 Hello everyone welcome on DanceCharlie channel. This is a special performance that means so much to me! I'm a huge Kylie fan since 1998...I have ever...
Winter Warmer Event Croydon Older people, disabled people and carers got to learn more about staying warm and keeping fuel bills low this winter at the OPeN Winter Warmer on the...
Dj Lethal Skillz 'Kill War Increase Da Peace' Second Fund raiser event took place in Amman @ Blue Fig to support Lebanon in ongoing crisis and raise money to aid homeless families and kids. Even...
Dj Lethal Skillz & Arrowz 'A Turntablist Meets a Violinist' Fund raiser event @ Kanabaye Amman to support Lebanon in ongoing crisis and raise money to aid homeless families and kids. Event Featuring Dj Lethal...
The 9/11 – 7/7 Connection On Friday 22nd July 2005, Ian Crane opened the Glastonbury Symposium with an analysis of the sinister geopolitical webs that have been spun, resultin...
Dj Lethal Skillz 'Kill War Increase Da Peace' Second Fund raiser event took place in Amman @ Blue Fig to support Lebanon in ongoing crisis and raise money to aid homeless families and kids. Even...
Dj Lethal Skillz & Arrowz 'A Turntablist Meets a Violinist' Fund raiser event @ Kanabaye Amman to support Lebanon in ongoing crisis and raise money to aid homeless families and kids. Event Featuring Dj Lethal...
The Road To February 10, 2008 On February 10th, a group that calls themselves Anonymous took to the streets in protest against Scientology. In 15 minutes, this video attempts to ...
Harry Chapin Memorial Run Against Hunger -- Cat's in the Cradle This annual event in Croton-on-Hudson, NY (just 30 miles north of New York City, in Westchester County, NY) was started just a few short months after...




Search This Site:










skin question

version 4.0.1 clean install error: could not find file ...\dotnetnuke_template.mdf'

log viewer - lots of errors.

httphandlers configuration error please help

changing the date colour bar?

child to parent

installation error: "...caching provider " threw an exception

server 2003 can't locate code-behind objects

user manuals

how to debug desktopmodules (c# web user controls) with dotnetnuke project

problem installation - please help me!

2nd parent portal

remote installation problem

space between menu and top pain

dnn3 root/subdirectory?

dotnetnuke 3.0.13 installation error

nuke sql on local--newbie question

portal alias assigmnet in dnn 4.0

install successful, but error when launching into application

gallery module woes

upgrading from dnn 4.0.0 to 4.0.2

help me dnn2 server error in '/' application ( althought it work well at local )

smtp setup question

my site finally went live, using dnn with godaddy. thanks all for your help. some more questions:

general upgrading question

sub domians & portals

beta 3 problem

help with dnn3 install error

getting my dnn site visible on another pc

error on install:object reference not set to an instance of an object.

  Privacy | Contact Us
All Times Are GMT