2
Reply

How to use bootstrap in asp.net controls

Harez Habeel

Harez Habeel

Dec 30 2017 1:41 PM
139
Hello there
 
I'm new to asp.net and bootstrap , i want to create a webform for data entry i used FormView Control , I want to make Controls of the webform responsive like FormView , text boxes textboxes labels and etc ,  how to do that below is a screen shot for the FormView Control that I have used and the source code:
 
<asp:FormView ID="FormView1" runat="server" DataKeyNames="StudentID"
DataSourceID="SqlDataSource1" Width="100%" Height="145px" AllowPaging="True">
<EditItemTemplate>
:<asp:Label ID="Label1" runat="server" Text="?????? ?????????"></asp:Label> <asp:Label ID="Label2" runat="server"></asp:Label>
<asp:Label ID="StudentIDLabel1" runat="server" Text='<%# Eval("StudentID") %>' />
<br />
???? ????:
<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="CoursesDataSource" DataTextField="CourseName" DataValueField="CoursesID"></asp:DropDownList>
<asp:SqlDataSource ID="CoursesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CoursesDBMSFinishedSQLConnectionString %>" SelectCommand="SELECT [CoursesID], [CourseName] FROM [CoursesTBL]"></asp:SqlDataSource>
<br />
???? ????????:
<asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="DirectoreDataSource" DataTextField="DirectoreName" DataValueField="DirectoreID"></asp:DropDownList>
<asp:SqlDataSource ID="DirectoreDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CoursesDBMSFinishedSQLConnectionString %>" SelectCommand="SELECT [DirectoreID], [DirectoreName] FROM [DirectoreTBL]"></asp:SqlDataSource>
<br />
???? ?????????:
<asp:TextBox ID="StudentNameTextBox" runat="server" Text='<%# Bind("StudentName") %>' />
<br />
????????? ?????? ?????????:
<asp:TextBox ID="StudentProfessionTextBox" runat="server" Text='<%# Bind("StudentProfession") %>' />
<br />
?????? ??????? ?????????:
<asp:TextBox ID="StudentMobileTextBox" runat="server" Text='<%# Bind("StudentMobile") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="??????????" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="????????????" />
</div>
</div>
</div>
</EditItemTemplate>
<InsertItemTemplate>
<br />
<br />
???? ????:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="CourseNameDataSource" DataTextField="CourseName" DataValueField="CoursesID"></asp:DropDownList>
<asp:SqlDataSource ID="CourseNameDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CoursesDBMSFinishedSQLConnectionString %>" SelectCommand="SELECT [CoursesID], [CourseName] FROM [CoursesTBL]"></asp:SqlDataSource>
<br />
???? ????????:
<asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="DirectoreDataSource" DataTextField="DirectoreName" DataValueField="DirectoreID"></asp:DropDownList>
<asp:SqlDataSource ID="DirectoreDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CoursesDBMSFinishedSQLConnectionString %>" SelectCommand="SELECT [DirectoreID], [DirectoreName] FROM [DirectoreTBL]"></asp:SqlDataSource>
<br />
???? ?????????:
<asp:TextBox ID="StudentNameTextBox" runat="server" Text='<%# Bind("StudentName") %>' />
<br />
????????? ?????? ?????????:
<asp:TextBox ID="StudentProfessionTextBox" runat="server" Text='<%# Bind("StudentProfession") %>' />
<br />
?????? ??????? ?????????:
<asp:TextBox ID="StudentMobileTextBox" runat="server" Text='<%# Bind("StudentMobile") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="????????" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="????????????" />
</div>
</div>
</div>
</InsertItemTemplate>
<ItemTemplate>
<br />
<br />
???? ?????????:
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>' />
<br />
<br />
???? ????:
<asp:Label ID="CourseIDLabel" runat="server" Text='<%# Bind("CourseName") %>' />
<br />
????????? ?????????:
<asp:Label ID="StudentDirectoreIDLabel" runat="server" Text='<%# Bind("DirectoreName") %>' />
<br />
???? ?????????:
<asp:Label ID="StudentNameLabel" runat="server" Text='<%# Bind("StudentName") %>' />
<br />
????????? ?????? ?????????:
<asp:Label ID="StudentProfessionLabel" runat="server" Text='<%# Bind("StudentProfession") %>' />
<br />
?????? ??????:
<asp:Label ID="StudentMobileLabel" runat="server" Text='<%# Bind("StudentMobile") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="????????????" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="???????" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="????????" />
</ItemTemplate>
</asp:FormView>
 

Answers (2)