T
Ted Singh
Is there anyway to dynamically change the OnClick method for an object? I
keep getting a BC30390 compilation error.
Essentially what I'm trying to do is dynamically put up buttons on the page
w/o putting <asp:ImageButton ...> in the html. Is there a better way?
Here is a snippet of my code:
<script ...>
sub Page_Load(Sender as Object, e as EventArgs)
dim i as integer
dim myButton as ImageButton
for i = 1 to 3
myButton = New ImageButton()
myButton.ID = "Button" & i
myButton.CssClass = "button" & i
myButton.OnClick="btnOnClick" & i
myForm.Controls.Add(myButton)
next
sub btnOnClick1(Sender as Object, e as EventArgs)
'do something really cool
end sub
</script>
<html>
...
</html>
keep getting a BC30390 compilation error.
Essentially what I'm trying to do is dynamically put up buttons on the page
w/o putting <asp:ImageButton ...> in the html. Is there a better way?
Here is a snippet of my code:
<script ...>
sub Page_Load(Sender as Object, e as EventArgs)
dim i as integer
dim myButton as ImageButton
for i = 1 to 3
myButton = New ImageButton()
myButton.ID = "Button" & i
myButton.CssClass = "button" & i
myButton.OnClick="btnOnClick" & i
myForm.Controls.Add(myButton)
next
sub btnOnClick1(Sender as Object, e as EventArgs)
'do something really cool
end sub
</script>
<html>
...
</html>