asp.net how to add items programmatically to detailsview -


I have the following code for each lookup table: I have been copying / pasting for each drop down list control till now I am But I think there is a better way to do this. I will be able to add database related related values ​​to DataTextField, DataValueField, control names in the stored proc, etc. Of course I would like to manually see table-like configuration on the database side, and specify other changes. TemplateField HeaderText = "Your ethnicity" & gt ;: ASP, but on the aspx page or .cs page, there is a better way to be copy / paste.

  & lt & LT; EditItemTemplate & gt; & Lt; ASP: DropDownList ID = "ddlEthnicity" runat = "server" DataSourceid = "ddlDAEthnicity" DataTextField = "Religion" DataValueField = "EthnicityID" SelectedValue = '& lt;% # Force ("Ethnicity")% & gt; & Gt; & Lt; / ASP: DropDownList & gt; & Lt; / EditItemTemplate & gt; & Lt; Itemmetlet & gt; & Lt; ASP: label run = "server" text = '& lt;% # bind ("breed")%> Id = "lblEthnicity" & gt; & Lt; / ASP: Labels & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt;  

Please let me know ... thank you

To create hook items or see data in the binding event, find the template in details and find some loop DDL if the program hooks it to the data source of your choice, then the selected value sets the main data item of the view view. Have to go

Hope it helps.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -