PC Review


Reply
Thread Tools Rate Thread

creation of controls dynamically and handling the controls

 
 
Murthy
Guest
Posts: n/a
 
      18th Mar 2005
Hi,

I would like to develop an application such that it

should create a combobox(server side control) at runtime

and how should handle these controls at runtime.
In my case i have a link button "add the

control".whenever i click on the button it should create

the combobox serverside control and i am using the code

behing file mechanisam.

Plz can any one help me.


Regards,
Krishna.
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      18th Mar 2005
Murthy,

This should be in the newsgroups, however I see that all those samples are
disapeared in Google. (It creates a kind of calandar with buttons)

Here it is again an old sample of my.

\\\Needs a panel on the page where the name panel is deleted
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim mybutton As Button
Dim i As Integer
For i = 0 To New Date().DaysInMonth _
(New Date().Year, New Date().Month) - 1
mybutton = New Button
mybutton.BackColor = Drawing.Color.White
mybutton.Text = (i + 1).ToString
mybutton.Width = New Unit(30)
Me.Panel1.Controls.Add(mybutton)
AddHandler mybutton.Click, AddressOf mybutton_Click
If (i + 1) Mod 5 = 0 Then
Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
End If
Next
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mylabel As New Label
Me.Panel1.Controls.Add(New LiteralControl("<BR><BR>"))
Me.Panel1.Controls.Add(mylabel)
mylabel.Text = "The day is: " & DirectCast(sender, Button).Text
End Sub
////

I hope this helps,

Cor


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling events triggered by dynamically created controls Nathan Sokalski Microsoft ASP .NET 1 27th Feb 2008 11:05 PM
Handling Events for Dynamically Created Controls Nathan Sokalski Microsoft VB .NET 2 23rd May 2005 01:03 PM
Handling Events for Dynamically Created Controls Nathan Sokalski Microsoft ASP .NET 2 23rd May 2005 01:03 PM
Handling dynamically created controls =?Utf-8?B?UGV0ZUJy?= Microsoft ASP .NET 1 30th Jul 2004 04:13 PM
Event handling for dynamically generated controls Steve Caliendo Microsoft ASP .NET 2 1st Mar 2004 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 PM.