For a new site I am developing I have a listview which has a dropdownlist populated from another datasource. I need to pass the value of this dropdownlist to the insert event of the listview. I have done this previously in VB.NET with the following code so my question is simply, can anyone convert this into C#?
Thanks
Code:
Sub insertRecipeIngredient(ByVal sender As Object, ByVal e As ListViewInsertEventArgs)
Dim ddl As DropDownList
ddl = e.Item.FindControl("dd_ingredientInsert")
If Not IsDBNull(ddl) Then
e.Values("ddl") = ddl.SelectedValue
SqlDataSource4.InsertParameters(0).DefaultValue = ddl.SelectedValue
End If
End Sub
Thanks