How to handle Child control button event
Steve C. Orr [MVP said:
You can inherit and extend the standard textbox control, enhancing it with
the numeric-only feature, and use that in your template column.
Here's an example:
http://www.aspnetpro.com/features/2004/06/asp200406so_f/asp200406so_f.asp
Here's a similar article of interest:
http://www.aspnetpro.com/NewsletterArticle/2004/01/asp200401de_l/asp200401de_l.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"smith Smith" <
[email protected]> wrote in message
news:
[email protected]...
> Using template column I have kept the text box in a grid control. How to
> write the code in such a way that user can enter only the numeric values
in
> this edit box. Any examples on web related to this will be of great
> help(Language is Vb.Net).
> Thanks
> Smith
>
>
Hi Professionals,
Please help me!
My code as follows:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
loadintro()
End Sub
Sub loadintro()
Dim objButton As New Button()
objButton.ID = "DYNBUTTON1"
objButton.Text = "DYNAMIC Button"
AddHandler objButton.Click, AddressOf UpdateIntro
PlaceHolder1.Controls.Add(objButton)
End Sub
Sub UpdateIntro(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("BUTTON EVENT FIRED")
End Sub
The above code generates button at runtime. This prog works fine thru page load event. But I copy this code inside the BUTTON1_CLICK event it is not working.
Note:
Assume that I had created a main button called BUTTON1 by using toolbox
if I click BUTTON1 then dynamically another button say DYNBUTTON1 should generate. When i click DYNBUTTON1 then I should able to call another method
called say DISPLAYMSG() has following code:
Sub Displaymsg(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("BUTTON EVENT FIRED")
End Sub
Can anybody help me to solve this problem.
Regard
Mike