473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

another sleepless night- cust control event not firing

hello folks, when i added this custom control to my webform along with
a submit button and while debugging i found that the cached 'change'
event never gets fired when i key in text in the textbox. it will only
fire if you add a 'text' attribute in the html.

if the change event doesnt fire the viewstate wont be kept for this
textbox. any idea what i am doing wrong ?....thanks
x

Imports System.ComponentModel
Imports System.Web.UI
<DefaultEvent("OnChange")Public Class WebCustomControl1
Inherits WebControls.WebControl
Event Change(ByVal sender As Object, ByVal e As EventArgs)
Property Text() As String
Get
If Not IsNothing(ViewState("Text")) Then
Return ViewState("Text")
Else
Return ""
End If
End Get
Set(ByVal Value As String)
ViewState("Text") = Value
OnChange(EventArgs.Empty)
End Set
End Property
Protected Overridable Sub OnChange(ByVal e As EventArgs)
RaiseEvent Change(Me, EventArgs.Empty)
End Sub
Protected Overrides Sub Render(ByVal output As _
System.Web.UI.HtmlTextWriter)
output.AddAttribute("value", Me.Text)
output.RenderBeginTag("Input")
output.RenderEndTag()
End Sub
End Class

Jan 5 '07 #1
0 868

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

Similar topics

3
by: JPM III | last post by:
I wrote a PHP script that allows me to post HTML entries to files on my server without going through FTP, yadda yadda. It works fine, and last night it updated both files properly. Today, it...
8
by: Skwerl | last post by:
Hi guys. I've written code to embed an ICC profile in a TIFF image, and I think my IO operations are slowing things down. It is taking about a second to embed each tag in 7-meg TIFF files. ...
6
by: Andreas Schmitt | last post by:
Ok. I got the following problem. I created the following array and executed a function : CField* Spielfeld; CreatePlayField( Spielfeld ); *************************************************...
5
by: Nick Stansbury | last post by:
Hi, Sorry for the obscure title but I'm afraid I can't think of a better way to describe what happened to one of my clerks last night. The guy was working late, made a series of changes (accross a...
6
by: Greg | last post by:
I am trying to change the value of one field in my query based on the value in another. If Field 1 had the text "ONACCNT" then in Feild 2 I want the date to change to today's date. Any help would...
3
by: Ray | last post by:
Any help? I have two tables. TABLE 1 one which shows all the days of the year with (Number) (date) Each day of the year (Yes/No) TABLE 2 with reservation details with (Autonumber)
8
by: daD | last post by:
I'm trying to write a small database that tracks people coming and going from a small campground. I need to have the current guests in the "current" table" and then have the ability to check them...
6
by: Brian L. Troutwine | last post by:
The heading comment to pprint reads: # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # ...
3
by: colleen1980 | last post by:
Hi: Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.