473,847 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generate dynamic textbox

56 New Member
hello everyone,
I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

can anyone has solution for this problem .

thanks in advance.
Jan 7 '08 #1
8 2675
PareshRathod
28 New Member
Hello Sejal,

First of all i will ask that are you asking it for web application or windows application?

And kindly write about the language in which you are developing, so that user can answer accordingly...

Paresh

hello everyone,
I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

can anyone has solution for this problem .

thanks in advance.
Jan 7 '08 #2
dip_developer
648 Recognized Expert Contributor
hello everyone,
I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

can anyone has solution for this problem .

thanks in advance.
creating dynamic textbox is easy.....on linkbutton's click event just write

Expand|Select|Wrap|Line Numbers
  1.  Dim tb As TextBox 
  2. tb=new Textbox
  3.  
in code you have to set the appropriate location for the textbox...

Expand|Select|Wrap|Line Numbers
  1.  tb.Location=new Point(x,y)
the scond portion of your code requires some learning.....pl ease learn about Database design......if a single company name/card type/card Name entry has 4 pin then you should maintain a second table for pin only.........

lastly but most importantly.... .............
please obey the posting guidelines..
you have not mention your Database/Language/Project type.....
Jan 7 '08 #3
sejal17
56 New Member
Hello Sejal,

First of all i will ask that are you asking it for web application or windows application?

And kindly write about the language in which you are developing, so that user can answer accordingly...

Paresh
Hello Paresh

I want it in asp.net with language C#.

Thnks in advance
Jan 7 '08 #4
Frinavale
9,735 Recognized Expert Moderator Expert
Hello Paresh

I want it in asp.net with language C#.

Thnks in advance
I'm currently working on an article explaining how to use dynamic controls in ASP.NET. The example in the article is in VB.NET but I think you can get the general idea of how to make it work in C# from it.

Please note that the article is still in rough draft stages.

The article on Using Dynamic Controls in Asp.NET.

-Frinny
Jan 7 '08 #5
PareshRathod
28 New Member
Can you please tell us about the problem you are facing???
Or you have no idea about the thing...

You can add the control to web form by:

TextBox txt = new TextBox();
this.form1.Cont rols.Add(txt);

You can add custom styles also to the above mentioned txt.
If you are having still problem, kindly contact me at <snipped> with screen shots your application, i will definitely solve it...

Paresh

Hello Sejal,

First of all i will ask that are you asking it for web application or windows application?

And kindly write about the language in which you are developing, so that user can answer accordingly...

Paresh
Jan 8 '08 #6
sejal17
56 New Member
Can you please tell us about the problem you are facing???
Or you have no idea about the thing...

You can add the control to web form by:

TextBox txt = new TextBox();
this.form1.Cont rols.Add(txt);

You can add custom styles also to the above mentioned txt.
If you are having still problem, kindly contact me at <snipped> with screen shots your application, i will definitely solve it...

Paresh



hello everyone,

I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

I want it for asp.net with language c#.

can anyone has solution for this problem .

thanks in advance.
Jan 9 '08 #7
Frinavale
9,735 Recognized Expert Moderator Expert
hello everyone,

I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

I want it for asp.net with language c#.

can anyone has solution for this problem .

thanks in advance.
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

-Moderator Frinny
Jan 9 '08 #8
dip_developer
648 Recognized Expert Contributor
hello everyone,

I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

also i have another fields on that page.

company name;
card type:
card Name:
pin:

i want this for pin field.

also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

I want it for asp.net with language c#.

can anyone has solution for this problem .

thanks in advance.
i have already given you the code.....the one line i missed is as follows......
Expand|Select|Wrap|Line Numbers
  1.  
  2. // Add control to the forms control collection after generating it
  3. // dynamically
  4. Me.Controls.Add(tb)
please dont post your question twice........

Coding in C# is not a hard task to do.....please learn the syntax...it has minimal difference with VB.NET.......yo u should be familiar with both the language......i ts for your betterment.....
Jan 10 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13719
by: Guy Harwood | last post by:
Hi, I have designed a textbox that inherits from the System.Windows.Forms.Textbox control. when the control is readonly the back color changes to a light blue to indicate that it is frozen. This all works well, but i would like the color to be configurable via the app.config file.
2
2379
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory application. There is a page where it asks the user for the number of tracks on a CD. After they enter the number of tracks, I would like to generate that number of text fields on the page (i.e. if user enters 30, I want to generate 30 text fields), so...
6
2656
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table runat="server" id="tabBill" /> <br>
7
1896
by: Abraham Luna | last post by:
how do i stop the dynamic validators from breaking explorer if i use a dynamic validator and move to a different control it breaks explorer and i can type in the page when i'm not supposed to. thank you.
1
1712
by: aekta | last post by:
Hello all, How we get The Value of Dynamic generate TextBox in asp.net? i have a web form and in which i want to create textbox dynamically by click on Button ...Now,on another button click I want to retrieve the value of dynamically created textbox. Please help me.If possible,try to explain me with example. Thanks, aekta
4
51689
Frinavale
by: Frinavale | last post by:
Introduction Sometimes, when developing web applications, we need to be able to dynamically load controls based on user selections. The following article describes a simple scenario where TextBox controls need to be dynamically loaded according to user input. This simple example can be further extended to dynamically load custom web user controls. Background Please familiarize yourself with the ASP.NET Page Life Cycle. It is crucial to...
1
4669
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by pressing Remove button the selecetd row will be removed. I used viewstate to keep my value for postback, I want by changing selectedvalue of...
0
3509
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by...
4
4770
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example to demonstrate my issues. Lets say I have a WebForm with a DropDownList where the user selects a number from 1 to 10 (the DropDownList is not dynamically created). I also have a button on there that I use to trigger a PostBack. Based on the...
0
9892
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10995
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10656
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10347
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9495
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5915
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4541
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.