Login  
Search All Forums
Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
AuthorForum: PowerWEB LiveControls for ASP.NET
Topic: adding events to dynamically created livecontrols
bseibenick

From: Toledo, OH USA
Posts: 22
Member Since: 05/16/05
posted June 12, 2008 11:26 AM

I am using dynamically creating LiveControls at runtime in my vb.net project. I am able to create and populate the controls without a problem. I am running into a problem in being able to an event or events that force a callback on one of my dynamically created textboxes so I can do some coding in the codebehind during an on-change event. Do you have an example on how to do this?

Thanks,
Brian
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted June 12, 2008 3:50 PM

Hi Brian,
I'm not sure if I understand what you are asking for help with.
If it's just wiring an event, you can let Intellisense do the work in VS.NET 2005+.
Type something like:

myLiveControl.TextChanged +=

and then a couple of tabs, and the environment will setup the handler for you.

Hope it helps,
-ken
bseibenick

From: Toledo, OH USA
Posts: 22
Member Since: 05/16/05
posted June 13, 2008 10:28 AM

Sorry, I forgot to mention that I am using vb.net where I cannot use the code you would in c# to add an event handler.

Have you done anything like this that would work with vb.net?

Brian
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted June 13, 2008 10:57 AM

Hi Brian,
The equivalent in VB.NET would be

AddHandler myLiveControl.TextChanged, AddressOf myLiveControl_TextChanged

...

Protected Sub myLiveControl_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
  'Event handler code
End Sub

-ken
bseibenick

From: Toledo, OH USA
Posts: 22
Member Since: 05/16/05
posted June 13, 2008 4:07 PM

Thank you...that is what I was looking for.

Brian
Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX