-
July 8th, 2003, 02:46 AM
#1
runs at server Question
Hi
I have a web control asp:textbox runat=server
I want to add a client side script that handles the OnTextChanged event
but I’m getting an error:
'myScriptFunc' is not a member of 'ASP.myPageName_aspx'
I understand that the page search for the method at the server side
How do I add a client side code to a web control that runs at server?
Thanks
Limor
-
July 8th, 2003, 09:08 AM
#2
Page will need Table1, and Label1
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
x = New Button()
x.Text = "Test Button"
x.ID = "MyButtonID2"
x.Attributes.Add("onclick", "javascript:alert('hello - this is from the client side!!')")
AddHandler x.Click, AddressOf DynamicClick
Me.Table1.Rows(0).Cells(0).Controls.Add(x)
End Sub
Public Sub DynamicClick(ByVal sender As Object, ByVal e As System.EventArgs)
Dim b As Button
b = CType(sender, System.Web.UI.WebControls.Button)
Label1.Text = "This is from server side -- You Clicked the Button! - " & sender.id & " "
End Sub
-
July 8th, 2003, 11:41 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|