哪种控件更适​​合管理用户 [英] which control is better for managing users

查看:60
本文介绍了哪种控件更适​​合管理用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我对在用户管理页面中使用数据列表或gridview感到困惑
管理是关于:在数据库中进行编辑,更新,删除
我的数据库包含数据:密码,用户名,电子邮件...以及一个名为image url的文本字段,其中包含每个图像路径. 因此您可以看到我的数据管理控件必须在编辑中包含一个上传控件.

我只在数据列表和gridview中很好
什么让我感到困惑:
数据列表很好且易于订购
但它没有像gridview这样的自动页面.

所以您建议我选择什么以及为什么
如果您为我编写一个简单的代码(特别是上传控件),将不胜感激

在此先感谢您.

Hello,

I''m confused of using datalist or gridview in my users managing page
the managing is about : editing , updating, deleting in database
and my database contains data : password,username,email ...and a text field named image url which contains each image path .
so as you see my data managing control has to include an upload control in the editing.

I''m good only in datalist and gridview
what is confusing me :
the datalist is good and easy in ordering the items
but it has no automatic pages like the gridview.

so what you advice me to choose and why
and it would be grateful if you write for me a simple code (specificly the upload control)

Thanks in advance.

推荐答案

使用Grid,您可以做很多事情,在这里,我使用了Telerik RadGrid,您可以尝试使用普通的asp网格,在这里,您可以做你想做的事



With Grid u can do lots of thing, here I have used the Telerik RadGrid , u can try with the normal asp grid, here u can do what ever u want to do



<telerik:RadGrid ID="wRGEmpDocuments" runat="server" AllowSorting="true" GridLines="Both"

                                                                Width="100%" OnInsertCommand="wRGEmpDocuments_InsertCommand" OnDeleteCommand="wRGEmpDocuments_DeleteCommand"

                                                                OnItemDataBound="wRGEmpDocuments_ItemDataBound" OnNeedDataSource="wRGEmpDocuments_NeedDataSource"

                                                                Skin="WebBlue" AllowAutomaticInserts="true" AllowPaging="True" OnUpdateCommand="wRGEmpDocuments_UpdateCommand">
                                                                <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                                                                <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"

                                                                    CommandItemDisplay="Top" DataKeyNames="SlNo" PageSize="7" HierarchyLoadMode="ServerOnDemand">
                                                                    <Columns>
                                                                        <telerik:GridBoundColumn UniqueName="DocumentName" DataField="DocumentName" HeaderText="Document Name"

                                                                            HeaderButtonType="TextButton" SortExpression="DocumentName">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn SortExpression="DocumentDescription" HeaderText="Description"

                                                                            HeaderButtonType="TextButton" DataField="DocumentDescription" UniqueName="DocumentDescription">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn SortExpression="DocumentId" HeaderText="Document" HeaderButtonType="TextButton"

                                                                            DataField="DocumentId" UniqueName="DocumentId">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="Active" HeaderStyle-HorizontalAlign="Left"

                                                                            HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Left">
                                                                        </telerik:GridCheckBoxColumn>
                                                                        <telerik:GridBoundColumn SortExpression="UploadedDoc" HeaderText="UploadedDoc" HeaderButtonType="TextButton"

                                                                            DataField="UploadedDoc" UniqueName="UploadedDoc">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-HorizontalAlign="Center"

                                                                            HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
                                                                        </telerik:GridEditCommandColumn>
                                                                        <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete ?" ConfirmDialogType="Classic"

                                                                            ConfirmTitle="Delete" ButtonType="ImageButton" HeaderText="Delete" CommandArgument="SlNo"

                                                                            UniqueName="Delete" CommandName="Delete" Text="Delete" HeaderStyle-HorizontalAlign="Center"

                                                                            ItemStyle-HorizontalAlign="Center">
                                                                        </telerik:GridButtonColumn>
                                                                        <telerik:GridTemplateColumn Visible="false">
                                                                            <ItemTemplate>
                                                                                <asp:HiddenField ID="whdnIsActive" runat="server" Value='<%#   Eval("IsActive") %>' />
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                    </Columns>
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                    <EditFormSettings EditFormType="Template" FormTableItemStyle-HorizontalAlign="Left">
                                                                        <FormTemplate>
                                                                            <table width="100%">
                                                                                <tr>
                                                                                    <td align="left" width="40%">
                                                                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                                                                            <ContentTemplate>
                                                                                                <asp:TextBox ID="wtxtDocumentName" runat="server" MaxLength="25" Text='<%#   Eval("DocumentName") %>'></asp:TextBox>
                                                                                                <asp:TextBox ID="wtxtDocumentDescription" runat="server" Text='<%#   Eval("DocumentDescription") %>'></asp:TextBox>
                                                                                                <asp:CheckBox ID="chkaprvdoc" runat="server" Checked='<%# (Container is GridEditFormInsertItem) ? true : Eval("IsActive") %>' />
                                                                                            </ContentTemplate>
                                                                                        </asp:UpdatePanel>
                                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" Display="None"

                                                                                            ControlToValidate="wtxtDocumentName" SetFocusOnError="true" ErrorMessage="Document Name is required.."

                                                                                            ValidationGroup='<%# (Container is GridEditFormInsertItem) ? "VG" : "VG1" %>'>
                                                                                        </asp:RequiredFieldValidator>
                                                                                        <act:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" TargetControlID="RequiredFieldValidator6"

                                                                                            Width="250px" WarningIconImageUrl="../Images/001_11.png">
                                                                                        </act:ValidatorCalloutExtender>
                                                                                    </td>
                                                                                    <td align="left" width="38%">
                                                                                        <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                                                                                            <ContentTemplate>
                                                                                                <table>
                                                                                                    <tr>
                                                                                                        <td align="left" valign="bottom">
                                                                                                            <asp:ImageButton ID="btnRevDocument" runat="server" Width="17px" Height="18px" ImageUrl="1304404807_gtk-cancel.png"

                                                                                                                CommandArgument="SlNo" CommandName="RemoveDoc" OnClick="btnRevDocument_Click"

                                                                                                                Text="Remove Document" ToolTip="Remove Document" />
                                                                                                            <asp:ImageButton ID="btnAddDocument" runat="server" Width="17px" Height="18px" ImageUrl="~/Images/1304403818_add.png"

                                                                                                                OnClick="btnAddDocument_Click" OnClientClick="showAddDoc()" Text="Add Document"

                                                                                                                ToolTip="Add Document" />
                                                                                                            <asp:Label ID="wlbluploadfilename" runat="server" Text='<%#   Eval("UploadedDoc") %>'></asp:Label>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                                <asp:HiddenField ID="whdnUploadedDoc" runat="server" Value='<%#   Eval("UploadedDocpath") %>' />
                                                                                            </ContentTemplate>
                                                                                        </asp:UpdatePanel>
                                                                                    </td>
                                                                                    <td width="20%">
                                                                                        <asp:Button ID="btnUpdate" runat="server" ValidationGroup='<%# (Container is GridEditFormInsertItem) ? "VG" : "VG1" %>'

                                                                                            Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                                                                    </td>
                                                                                    <td>
                                                                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"

                                                                                            CommandName="Cancel" />
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </FormTemplate>
                                                                    </EditFormSettings>
                                                                </MasterTableView>
                                                                <ActiveItemStyle HorizontalAlign="Left" />
                                                                <AlternatingItemStyle HorizontalAlign="Left" />
                                                            </telerik:RadGrid>


这篇关于哪种控件更适​​合管理用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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