如何在asp.net中添加带控件的Html表 [英] how to add Html table with control in asp.net

查看:106
本文介绍了如何在asp.net中添加带控件的Html表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个标题为专业培训的HTML表格,其中包含3个文本框。该文本稍后将作为数据保存在我的数据库中。但是,我希望将另一个专业培训记录添加到数据库中,并附带新数据。所以我拿了一个添加按钮,帮助创建另一个控件。请帮我看看如何创建新控件以及如何将数据插入我的数据库。请。请。请。



Hi,

I have an HTML table titled "Professional Training" which contains 3 text-boxes. The text later gets saved as data in my database. However, I want another "Professional Training" record added into database, with new data. So I take an add button which help the create another control. Please help me with how to create the new controls and how to insert the data into my database. Please. Please. Please.

<table class="TableWorkArea" border="1px" cellpadding="3" style="border-collapse: collapse">   <tr>
                  <td class="TableHeading" colspan="4">
                                    SECTION G : PROFESSIONAL TRAINING</td>
               </tr>
                 <tr>
                     <td class="TDLeftLabel" width="18%">
                                    Training On
                        </td>
                                <td class="TDRightInput" width="32%">
                                    <asp:TextBox runat="server" ID="txtTrainingOn"

                                           CssClass="TextBoxFixed" TabIndex="14" Width="196px"></asp:TextBox>
                                </td>
                             </tr>
                                <tr>
                                <td class="TDLeftLabel" width="18%">
                                  Training Duration
                                </td>
                                <td class="TDRightInput" width="32%">
                                   <asp:TextBox runat="server" ID="txtTrainingDuration"  CssClass="TextBoxFixed" TabIndex="14" Width="196px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="TDLeftLabel" width="18%">
                                    Other Info [If Any] 
                                </td>
                                <td class="TDRightInput" colspan="3">
                                    <asp:TextBox runat="server" ID="txtTraningOther" CssClass="TextBoxFixed"  Width="196px"></asp:TextBox>
                                   
                                </td>
                            </tr>
                            
                            <tr>
                                <td class="TDLeftLabel" colspan="4"><asp:Button ID="btnTraningAdd" runat="server" Text="Add" /></td>
                                
                            </tr>
                            <tr><td class="TDLeftLabel" style="padding-removed366px" colspan="4"><asp:Button ID="btnProfessionalTrainingSave" runat="server" Text="Continue" />
                                <asp:Button ID="btnProfessionalTrainingEdit" runat="server" Text="Edit" /></td></tr>
                             </table>

推荐答案

请帮助我如何创建新控件以及如何将数据插入我的数据库

以下应该是添加/编辑页面设计:

1.有一个单页设计(如上所述)

2.根据需要,使用相同的设计进行添加和编辑。

3.如果你有''添加''需要,然后用e显示上面的页面空白。提交时,将数据保存在数据库中并继续运行

4.如果您有编辑需要,则显示填充数据的同一页面。在提交时,将更改的数据保存回数据库并继续。

如果是编辑,您将拥有一个唯一的ID号来跟踪它。如果添加,您不需要任何ID。



试试。
Please help me with how to create the new controls and how to insert the data into my database
Following should be the add/edit page design:
1. Have a single page design (lets say as above)
2. Based on the need, use the same design for add as well as edit.
3. If you have ''add'' need, then show the above page with everything blank. On submit, save the data in DB and move on
4. If you have ''edit'' need, then show the same page filled with the data. On submit, save the changed data back in DB and move on.
In case of edit, you will have a unique ID number to track it. In case of add, you don''t need any ID.

Try out.


这篇关于如何在asp.net中添加带控件的Html表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆