Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > generate textboxes dynamically

Reply
Thread Tools

generate textboxes dynamically

 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      09-17-2007
Hi,

I've a textbox called MyTextBox in my form and I would like to generate 10
other textboxes dynamically as an instance of Mytexbox that have the same
events and properties.
how can I do it
--
Regards,
M.Rochdi
 
Reply With Quote
 
 
 
 
Just Me
Guest
Posts: n/a
 
      09-19-2007
Erm, well lets first get something straight. Your 'MyTextBox' is an
Instance of TextBox. You cannot derive from an instance of a class only
from the class itself.

In order to acheive what you are looking for you would have to create a
class which inherits from TextBox and set the properties as you want them
during constrcution. And then instantiate from that.

As far as events are concerned, if you want all the text boxes to "Share"
the same event handlers, this can be added programatically using the
AddEvent Handler.

Perhaps it would server a better purpose to explain exactly what you are
trying to acheive and why. This will ellicit a more intelligent response.



"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I've a textbox called MyTextBox in my form and I would like to generate 10
> other textboxes dynamically as an instance of Mytexbox that have the same
> events and properties.
> how can I do it
> --
> Regards,
> M.Rochdi



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Dynamically generate textboxes using javascript Sirisha Javascript 1 02-27-2007 11:14 AM
How do you query the values of textboxes dynamically created in a Panel container?? SD ASP .Net 3 06-23-2005 10:06 PM
How to use custom validators for dynamically genrated textboxes Charith Jayasundara via .NET 247 ASP .Net 2 03-23-2005 01:51 PM
dynamically creating textboxes based on sql records Tony ASP .Net 5 06-27-2004 08:57 PM
TextBoxes created dynamically : How to store data? Forconi Boris via .NET 247 ASP .Net 2 06-18-2004 09:09 AM



Advertisments