Click here to Skip to main content
15,912,507 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
how to raise event for a UserControl textbox.
i need to raise a TextChanged() event for a UserControl which is been called in another Web Page.

regards,
aamir
Posted
Comments
Sandeep Mewara 26-Jul-12 13:16pm    
BTW, you ask so many questions. You should keep a habit of marking solutions as answers once they help.
aamir07 27-Jul-12 1:48am    
sandeep,
i have solved the questions by myself....and i raise questions for to know new things here and to take the given post suggestions and try out....and for ur info i do mark answers once they fullfill my answers...u might not be seeing them

Step1:-do this in your your usercontrol for fired textchange event
VB
'declare the delegate
Public Delegate Sub TextChangedHandler(ByVal sender As Object, ByVal e As System.EventArgs)
    
    'Public Event TxtChang As TextChangedHandler
    Public Event TxtChanged As TextChangedHandler
 Protected Sub TextDatepicker_TextChanged(sender As Object, e As EventArgs) Handles TextDatepicker.TextChanged
        ' RaiseEvent TxtChang(sender, e)
        RaiseEvent TxtChanged(sender, e)


step2:- do this is on your code page

VB
 Public Sub dtJSCalendarControlLoc_TxtChanged(sender As Object, e As EventArgs) Handles dtJSCalendarControlShift.TxtChanged
        Try
           ' btn_showCal(sender, e)
'put here your method or logic code
        Catch ex As Exception

        End Try

    End Sub
 
Share this answer
 
Comments
The Cool Cat 21-May-20 4:48am    
Thank you so much, this helped me alot. :)
Here, have a look at this: Creating User Controls in ASP.NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900