I have a simple list and I created a New Item Form using Sharepoint:FormField to bound list data to fields, but I would also like to know if there is a way to do the form using asp.net controls.
My problem is that I have 2 cascading dropdownlistboxes implemented as asp.net controls Project Name - Project Module that implement my business logic and i would like to bind them to list data.
Thank you !
A detailed description of my test project: I want to build a list to allow team members to report time spent in projects, working on project modules.
So I created a list that contains a couple of projects and a couple of project modules. A single text column with project name, and a multiple line text column that contains all the project work items .
I created another list (Time Management) that should contain the actual time report data: A user column, a date column, a number of hours column, a project name, a project module.
Afterwards I wanted to change the New Form on the Time Management list to include a 2 cascading drop down boxes that will allow the user to select the project name and afterwards the Project Work Item, so I created a new Visual Web Part and added only 2 drop down boxes with some custom logic to link to the Project List and retrieve data:
My .ascx code:
Project Name:<asp:DropDownList ID="ProjectName" runat="server"
AutoPostBack="true" onselectedindexchanged="ProjectName_SelectedIndexChanged" />
Project Module:<asp:DropDownList ID="ProjectModule" runat="server" />
<SharePoint:SaveButton ID="btnSave" runat="server" ControlMode="New" />
<SharePoint:GoBackButton ID="btnBack" runat="server" />
The problem is that the 2 dropdownlists are not binded to New Item Object; instead all the examples that I have use a SharePoint:FormField control that handles the binding automatically, and I was wondering if I can do the binding myself directly on the asp controls.
I found an interesting link here about Data Binding on asp controls: Is there a good reference SharePoint's databinding syntax? but it's not beginner friendly.