Bilawal Niaz

Bilawal Niaz

  • NA
  • 110
  • 15.5k

how to add drop down list in list view?

Jun 20 2016 6:13 AM
when i run the code second dropdown list will not work, they can not open why?
 
<InsertItemTemplate>
<tr>
<td>
<asp:Button runat="server" CommandName="Insert" Text="Insert" ID="InsertButton" CssClass="btn-warning" Width="50px" Height="25px" />
<asp:Button runat="server" CommandName="Cancel" Text="Clear" ID="CancelButton" CssClass="btn-warning" Width="50px" Height="25px" />
</td>
<td>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img alt="as" src="Images/loader1.gif" style="width: 30px; height: 30px" />
</ProgressTemplate>
</asp:UpdateProgress>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("ProvinceId") %>' CssClass="form-control" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" DataSourceID="SqlDataSource4" DataTextField="ProvinceName" DataValueField="ProvinceId"></asp:DropDownList>
<asp:SqlDataSource runat="server" ID="SqlDataSource4" ConnectionString='<%$ ConnectionStrings:CRMSConnectionString %>' SelectCommand="SELECT * FROM [Province]"></asp:SqlDataSource>
</td>
<td>
<asp:DropDownList ID="DropDownList4" runat="server" SelectedValue='<%# Bind("CityId") %>' CssClass="form-control" DataSourceID="SqlDataSource5" DataTextField="CityName" DataValueField="CityId"></asp:DropDownList>
<asp:SqlDataSource runat="server" ID="SqlDataSource5" ConnectionString='<%$ ConnectionStrings:CRMSConnectionString %>' SelectCommand="SELECT City.CityId, City.CityName FROM City INNER JOIN Province ON City.ProvinceId = Province.ProvinceId WHERE (City.ProvinceId = @ProvinceId)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" PropertyName="SelectedValue" Name="ProvinceId"></asp:ControlParameter>
</SelectParameters>
</asp:SqlDataSource>
</td>
<td>
<asp:TextBox Text='<%# Bind("AreaName") %>' runat="server" ID="AreaNameTextBox" CssClass="form-control" /></td>
</tr>
</InsertItemTemplate>
 

Answers (2)