473,669 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically create controls ?

Hi,

What I would like to do is have a different number of controls on a web form
based on a users configuration. So, some users will need 5 textboxes, and
some will only need 1. I don't want to use the .visible property, and
design a form that always has the maximum # of textboxes on it. Is it
possible to dim an object as a new control, and then dynamically place it on
the web form when the page loads?

Thanks,

Steve
Nov 18 '05 #1
3 917
Yes, it most certainly is. And there are about a half-dozen ways to do it,
depending upon your app's requirements.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Steven Caliendo" <sc*******@epio n.com> wrote in message
news:#G******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

What I would like to do is have a different number of controls on a web form based on a users configuration. So, some users will need 5 textboxes, and
some will only need 1. I don't want to use the .visible property, and
design a form that always has the maximum # of textboxes on it. Is it
possible to dim an object as a new control, and then dynamically place it on the web form when the page loads?

Thanks,

Steve

Nov 18 '05 #2
Ok, Great ! So how about just one of them? I know dim'ing an object works,
but there doesn't appear to be top & left properties, so how do I place
them?

Thanks,

Steve

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:O8******** ******@TK2MSFTN GP09.phx.gbl...
Yes, it most certainly is. And there are about a half-dozen ways to do it,
depending upon your app's requirements.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Steven Caliendo" <sc*******@epio n.com> wrote in message
news:#G******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

What I would like to do is have a different number of controls on a web form
based on a users configuration. So, some users will need 5 textboxes, and some will only need 1. I don't want to use the .visible property, and
design a form that always has the maximum # of textboxes on it. Is it
possible to dim an object as a new control, and then dynamically place

it on
the web form when the page loads?

Thanks,

Steve


Nov 18 '05 #3
> Ok, Great ! So how about just one of them? I know dim'ing an object
works,
but there doesn't appear to be top & left properties, so how do I place
them?
Well, Steve, it's a can of worms. Not exactly something I could write a
couple of paragraphs on and send you on your way. Instead, I'm sending a
link to the freely downloadable Microsoft .Net SDK, which will tell you
everything you need to know about this and probably any other question you
can come up with.

http://www.microsoft.com/downloads/d...displaylang=en

If, after checking out the SDK, you have any specific questions, come on
back. Happy Holidays!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Steven Caliendo" <sc*******@epio n.com> wrote in message
news:Oi******** ******@TK2MSFTN GP12.phx.gbl... Ok, Great ! So how about just one of them? I know dim'ing an object works, but there doesn't appear to be top & left properties, so how do I place
them?

Thanks,

Steve

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:O8******** ******@TK2MSFTN GP09.phx.gbl...
Yes, it most certainly is. And there are about a half-dozen ways to do it,
depending upon your app's requirements.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Steven Caliendo" <sc*******@epio n.com> wrote in message
news:#G******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

What I would like to do is have a different number of controls on a
web form
based on a users configuration. So, some users will need 5 textboxes,

and some will only need 1. I don't want to use the .visible property, and
design a form that always has the maximum # of textboxes on it. Is it
possible to dim an object as a new control, and then dynamically place

it
on
the web form when the page loads?

Thanks,

Steve



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10796
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would then like that, when clicking the LinkButton, the user can be navigated to another page, carrying a variable. I would like to use server.transfer method instead of QueryString as I don't want the carried variable to be visible for the user.
8
4310
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
4
2494
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in the table. I know that I can dynamically add controls (eg a textbox) to the page controls collection of a web form in a server event which will then be rendered onto the form, as in the following snippet: System.Web.UI.WebControls.TextBox...
1
2569
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g. wucCustomerInfo.ascx,
4
3109
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three UserControls into the PlaceHolder's child control collection depending upon which of the three radio buttons is selected. Each of the three UserControls have postback events themselves triggered by button clicks. The problem I'm having is keeping track of...
2
2907
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to avoid the problem by avoiding the table control or resorting to databound controls that better manage state for me. I hope to understand how to solve the problem by using the Table web control and sticking to the approach of building the table at run...
1
1022
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a variable (targetId) in to the usercontrol (IntergySite.aspx) by calling its setter method. Currently, I am using if-then-else and hardcoded the User Control Object to do casting and call the setter method. Question: Is there any way I could load,...
3
2535
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes, RadioButtonLists and CheckboxLists. On postback, those controls are not present nor their valves in Request.Form.AllKeys.
9
7036
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related to VB, plus the address bar would show something like this: www.somethinghere?id=3 and if you change number 3 from the address bar to (for example) 34 or 71 you would get different page with the same formatting like I.e: www.somethinghere?id=34...
4
11004
by: Craig Buchanan | last post by:
I dynamically add data-bound templates to a gridview in my ascx control. while this works correctly when the gridview is databound to the datatable, i'm having issues on postback. i would like to iterate thru the gridview's rows, examine the databound controls, then perform a database action. for some reason, i can't find the controls. i have a two templates: one that uses a label the other uses a textbox to display data. when the...
0
8465
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
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
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
8809
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...
1
8588
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2797
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
2
1788
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.