dynamic-controls

[ASP.NET] Controls do not appear on dynamically created user control

I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox ID="dateTextBox" runat="server"></asp:TextBox> <asp:TextBox ID="timeTextBox" runat="server"></asp:TextBox> I am dynamically creating this control in another user control: Controls.Add(GenerateDateTime(parameter)); private DateTimeUC GenerateDateT...

How to retrieve data from dynamically added textboxes?

Im adding textboxes (not a fixed number of textboxes) dynamically to a form on ASP.NET page, how do i read back data from these textboxes? ...

Insert dynamic controls into diddle of controls collection

Hello folks--this is my very first post! I'm pretty desperate so I'm going above and beyond my standard googling. I believe this is an advanced or expert-level .NET question. The problem is that I have built a .NET web application that needs to be able to insert user controls dynamically into the middle of a list. I'm quite comfortable ...

Connecting a button and a text box in Visual Basic

I'm stuck on this exercise that asks me to create a text box and a button. Each time the button is pressed it is supposed to add 1 to the text box. Anyone know how to approach this? ...

Dynamically Created User Controls In C#

I am working in a C# winforms project and I have a user control which gets loaded upon its selection from a tool-strip menu. I have a dictionary lookup set to occur upon form load of the user control for other functionality. Also, when I close the user control I am just using the ".Hide();" method. I noticed that when I load the user con...

Adding ClickEvent on dynamic LinkButtons in OnLoadComplete

Hi, I'm creating a file-browser in ASP.Net but I have run into a problem which I believe relates to event-wireing on dynamic controls. I'll explain what my code does here: When my page loads (OnLoad) i call a method (createStuff()) that create a number of linkbuttons (representing folders in a current directory) which are wired to an e...

Get User Input From Dynamic Controls

I am looking to create a dynamic survey. Where I generate all the question controls from the database. Below is an example of what I am trying to do (without the database part). I am able to display questions as seen below. I am unable to read the users input. Does anyone have any ideas. I have looked into the viewstate, but I ...

How to pull PostBack data into a dynamically added UserControl (.NET)?

I have a Panel on my Page: <asp:Panel ID="pnlTest" runat="server" /> Then I dynamically add a TextBox to it on Page_Load: TextBox simpleTextBox = new TextBox(); pnlTest.Controls.Add(simpleTextBox); simpleTextBox.ID = "SimpleTextBox-1"; Is there a way to pull in the information typed in this TextBox without pulling it di...

ASP.NET - How to dynamically generate Labels

I am doing a project on Flight Booking system. My part is to enter the details of the passengers travelling. These passengers may include Adults as well as children. So I need to dynamically generate separate labels and text boxes for all the passengers travelling so that details of all them can be entered. How can I do that? ...

Using FindControl on Dynamically Generated Controls

I have some ASP.NET code that dynamically generates rows and cells for a Table control on the page. I have specifically set the ID of each cell, but I am having trouble getting FindControl to actually find them. Here's the code that I use to create the cells: tbc = New TableCell tbr.Cells.Add(tbc) tbc.ID = String.Format("tc_{0}-{1}-...

ASP.Net: drop down list and data source created dynamically

I have about 10 drop down list controls that get populated. Instead of copying/pasting and modifying a few fields on each, I would like to create them programmatically. Can this be done? Here is what one of them looks like. I would like to programmatically add 10 dropdownlist controls and their respective SqlDataSource controls. <...

Dynamic Controls, Update Panels and Events - Best Way To Achieve My Result

Been pulling my hair out and doing a bit of looking on the web to try and figure out an elegant solution to my issue. I have a ProductImages.aspx page. It shows all of the images associated with that product in a dynamically created list. Events are wired up to each picture to allow you to update it. This works fine. However, I have ...

Dynamic ASP.net Web Forms

I am creating an ASP.NET application in which the administrator of the program will be able to define custom fields for forms that the users will fill out and submit. The admin needs to define various types of fields like checkboxes, radio buttons, textboxes, and textareas for the user to fill out. The admin also can define whether thes...

Validator nightmare on dynamic control C#

I have a requirement to add a RequiredFieldValidator and RegularExpressionValidator to a dynamically created textbox in a dynamically generated tablecell, inside a Web User Control in the Content Area of a Page created from a Master. The problem, as you can probably guess, is trying to dynamically set the ControlToValidate property to l...

Postback problem for my custom control load wizard

I have some problem that happens when controls are loaded in init and it still doesn't help me to get proper postback event fired on time. I am trying to create a rich wizard control that will enable switching, links with description, completely customized steps, integration of substeps - by using dynamic control load that is avoids sta...

Dynamically Change User Control in ASP.Net

I'm trying to create a web page that will display an appropriate user control based on the selected value of a drop down list. Basically the page layout is this: Drop Down Selection < User Control created based on drop down selection > I have it half working... the controls are changing when the selection changes. In OnInit(), I dynam...

ASP.NET WebControl & Page - Adding controls (like TextBox) dynamically

I'm trying to create a custom server control (WebControl) with a text box. I add asp.net textbox to the custom control in CreateChildControls override. In OnInit override I add event handler to TextBox.TextChanged. Everything works, except that TextChanged never fires. I looked at viewstate and it looks like my textbox never saves its ...

HELP! Get value of dynamic control radio button!

Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment. Below is what i am trying to do: First when the user click the button, it will populate a dynamic table with radio button for the survey questionnaire inside a placeholder. However, I was unable to ...

How to pass custom value to asp.net control on aspx page?

I need to generate the following in ASP.NET page. What's the best, easiest way to do that? Simplified example. So to custom property I need to pass string which would include index (i) to the property of the control. I could do it from codebehind, but it would be simpler and easier if I could keep it in .aspx file. <table> <% for(...

accessing hidden-input values edited by javascript in c# ASP.NET

I have dynamically created hidden input controls in a c# codebehind file, and then populate their values with javascript. I now want to access these variables in c#. Firebug shows that the values do change with javascript, but i'm getting the origional values back in the code behind. Any insight would be much appreciated. Javascript: ...