Child control event handling....

S

smith Smith

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
 
Joined
Aug 26, 2006
Messages
2
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top