Questions tagged [dynamic-controls]

310 questions
0
votes
1 answer

Selecting the shortest item string from dropdownlist in C# Asp.net

I have multiple dynamically generated dropdownlists bound with database. I want the shortest string value to be shown at index 0 in each dropdown. The sample code is: DropDownList ddlTemplate = new DropDownList(); ddlTemplate.ID = "ddlTemplate|" +…
naeemmalik
  • 67
  • 2
  • 11
0
votes
2 answers

Dynamic button not firing click event or page life cycle for button(not dynamic)

I've got different entity types and depending on which entity is clicked (dropdownlist) the amount and types of uploads which is needed is different every time. Thus, I am creating multiple dynamic upload controls in a dynamic table with a dynamic…
Kerieks
  • 1,042
  • 7
  • 25
  • 53
0
votes
2 answers

How do I get a value from a dynamic control?

I've got a form with a picturecontrol (default to black bg) and I have a flowlayoutpanel underneath. On the form's load it cycles through a folder of images and creates a thumbnail (picturecontrol) inside the flowlayoutpanel. What I want to do is…
rmalex
  • 21
  • 6
0
votes
1 answer

C# Generating Labels Dynamically

I have got the below code to generate labels using for loop, however there is a problem with the for loop, if the productList has 4 items, it generates 1 label instead of 4. I can't figure out what the problem is. List carList =…
PRCube
  • 566
  • 2
  • 6
  • 19
0
votes
1 answer

Find textbox control in ASP dynamic table

I am dynamically creating a table that contains a textbox. I am doing so with the following code: foreach (DataRow row in Score_Sheet.Rows) // Loop over the rows. { int rowIndex = Score_Sheet.Rows.IndexOf(row); //…
user2219930
  • 125
  • 17
0
votes
1 answer

Cannot Fetch Text Property for Dynamically Generated Textboxes c#

I create a DIV that runs on the server and then dynamically create and add TextBox controls to that DIV. Later when I try to read the Text property of each TextBox in DIV I cannot get the controls... How do I accomplish this? DIV that runs at…
ѺȐeallү
  • 2,887
  • 3
  • 22
  • 34
0
votes
1 answer

No server-side click event for dynamically-generated LinkButton

I'm trying to add a new section on one of my system's main pages (web forms) that would allow users to see documents they've uploaded into folders they've created. I don't know in advance how many folders they've set up or what the folders are…
Mike
  • 417
  • 7
  • 28
0
votes
1 answer

Dynamically Created LinkButton causing UpdatePanel to do Full Postback

Ok, so I'm creating a custom calendar (the one's I've found for free don't fit my needs or are too clunky and the paid ones are well not free) in ASP.NET. I'm using a number of UpdatePanels to allow for the changing of months and the display of the…
Thomas Hawkins
  • 103
  • 2
  • 12
0
votes
2 answers

Dynamic columns in DataGridView control (ASP.NET)

I have a List which contains records in the following template. Date | User | Question | Answer(Option) For which the records will be like 02/02/2015 | Harry | What is..? | 5 02/02/2015 | Harry | How..? | 4 02/03/2015 | Alice | What is..? |…
Rahul R G
  • 113
  • 8
0
votes
1 answer

Find dynamically created controls inside Literal in asp.net page

Following is my code -- the .aspx file
-- the .aspx.cs file Literal lit1 = new Literal(); lit1.Text = ""; lit1.Text += "
user217648
  • 3,338
  • 9
  • 37
  • 61
0
votes
2 answers

Dynamically adding controls from an Event after Page_Init

Might seem like a daft title as you shouldn't add dynamic controls after Page_Init if you want to maintain ViewState, but I couldn't think of a better way of explaining the problem. I have a class similar to the following: public class WebCustomForm…
djdd87
  • 67,346
  • 27
  • 156
  • 195
0
votes
1 answer

Can't access HTML input controls created in code behind in a literal

I have an aspx page and added a literal control: Then, in codebehind I'm using a for sentence to massively create controls, the idea is something like this: ControlLiteral.Text =…
franko_camron
  • 1,288
  • 4
  • 14
  • 30
0
votes
1 answer

How to link a div Click to button click server side for dynamic controls

I've got a requirement where I need to be able to click dynamically generated div's So,I've generated buttons also dynamically and want to link the ClickEvent of Button to div's Click event. for (int i = 0; i < DtUsers.Rows.Count; i++) { …
RealSteel
  • 1,871
  • 3
  • 37
  • 74
0
votes
4 answers

What prevents a user from adding controls to an ASP.NET page client side?

This goes back to my other question which I thought was sufficiently answers but upon reflect am not sure that it was (sorry). Backgrounder: I am generating a form dynamically. I am pulling from the database the controls. I must associate each…
Curtis White
  • 6,213
  • 12
  • 59
  • 83
0
votes
5 answers

Secure to store an ID in an ASP.NET control ID?

I'm auto-generating a form in my ASP.NET page. This is already tested and working. I want to know if: If there are any security problems with storing the database ID as part of my controls ID? I can see think of 2 issues: the id will be visible in…
Curtis White
  • 6,213
  • 12
  • 59
  • 83