|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am creating a number of buttons on the form on a particular event using VB.net. Source Code for adding button is as follows: Private Sub AddButtonToThisApplication(ByVal x) Dim btn1 As New Button() Me.Controls.Add(btn1) btn1.Left = 0 btn1.Height = 25 btn1.Width = 25 btn1.Name = "btn" & x btn1.Text = x btn1.Visible = True btn1.Tag = x btn1.Dock = DockStyle.Left Me.Width = Me.Width + 25 Me.Left = Me.Left - 25 fpos = fpos - 25 End Sub I want to call a function on click event of each button with different parameter. I used trapping click event on form using "keypreview" & checking the name of src of event, it works fine when I click on form but doesnt work when I click on any of these buttons. How can I detect click event on these buttons & which button is being clicked? Last edited by sushant : February 12th, 2003 at 11:23 PM. |
|
#2
|
|||
|
|||
|
On client-side or server side?
On server side... Code:
<%
If Len(Request.Form("button1")) > 0 Then
Response.Write("You clicked button one.")
End If
If Len(Request.Form("button2")) > 0 Then
Response.Write("You clicked button two.")
End If
%>
<form method="POST">
<p><INPUT type="Submit" value="Button1" id=button1 name=button1></p>
<p><INPUT type="Submit" value="Button2" id=button2 name=button2></p>
</form>
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Dynamic Buttons |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|