c# - How do I create new controls inserted into newly generated HTML on runtime? -
I am still new to ASP.NET, but I myself get stuck on a problem which is not too high One problem ..
Now I have a page that holds this div:
& Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt; & Lt; / Div & gt; How it looks:
Let me press a user + button (addAdditionalDDLColumns). When I press that button, I want to reveal a new table row in the same control so that it looks like at the time of the runtime:
& lt; Div id = "EditSurveySetID" class = "EditSurveySet" runat = "server" & gt; & Lt; Div class = "cell" & gt; & Lt; Div class = "cell-title" & gt; Survey Set (Le) & lt; / Div & gt; & Lt; Table ID = "SurveySetSetData" run = "Server" style = "margin: 10px;" & Gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; Td square = "form_labelSurveySet" style = "width: 330px;" & Gt; & Lt; Input type = "button" value = "-" & gt; Survey Set 1: & lt; Input id = "EditSurveySetTitle" runat = "server" style = "width: 200px;" Value = "Netherlands" & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; ASP: Dropdown List ID = "DDL ServiceSet Services" Runat = "Server" & gt; & Lt; / ASP: DropDownList & gt; & Lt; ASP: Button ID = "Add Extra DDL Column" Runat = "Server" Text = "+" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td square = "form_labelSurveySet" style = "width: 330px;" & Gt; & Lt; Input type = "button" value = "-" & gt; Survey Set 2: & lt; Input id = "text1" runat = "server" style = "width: 200px;" Value = "Netherlands" & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Asp: dropdown list id = "dropdown list 1" runat = "server" & gt; & Lt; / ASP: DropDownList & gt; & Lt; ASP: Button ID = "Button 1" Runat = "Server" Text = "+" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt; & Lt; / Div & gt; Or in the image:
So the way I see, some new HTML code + button clicks are generated on some control (dropdown list, button with another functionality (?), Possibly a text form instead of input field).
Let's get the question now:
- How do I create HTML code that will create a new table row
- How can I control that this HTML code (In this case, this matter should be subject to current
- [Unclear / abstract question] Finally a user can probably set 'Unlimited Survey Setting' from 1. If the user creates 4 survey sets, So finally when I suppress this button I have 4 draws related to 4 survey sets I will save 4 selected properties of downlists. How do I call each individual dropdown list to get the data? What I am actually asking, I think, W is still on the auto generated dropdown list creation of my previous two questions. It is possible to assign program ID.
How can I do this? Any advice and suggestions are very welcome!
You can use and updatePanel and dynamically behind the new ASP control code.
This can be expensive because it means that when your user clicks the" Add "button , Your application will be going back to the server, but I'm not sure how to get it strictly on the customer-side, but by using new asp.net on the server side, Nothing is to be stopped.
If you want to enclose new controls with custom HTML, then you can change it using the placeholding component, along with the raw text (your HTML) during the callback.
Comments
Post a Comment