<asp:GridView ID="gdvAssetType" runat ="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" EnableModelValidation="True" onpageindexchanging="gdvAssetType_PageIndexChanging" onrowcommand="gdvAssetType_RowCommand" Width="747px"> <Columns> <asp:TemplateField HeaderText="Sr No."> <ItemTemplate > <asp:Label ID="lbSerialNo" runat ="server" Text='<%#Container.DataItemIndex+1 %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> </asp:TemplateField> <asp:BoundField HeaderText="Asset Type" DataField="AssetType"> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> </asp:BoundField> <asp:TemplateField HeaderText="Edit"> <ItemTemplate > <asp:ImageButton ID="imgbtnEdit" runat ="server" CommandArgument ='<%#Eval("AssetTypeId") %>' CommandName ="EditAssetType" ImageUrl ="../_img/ico_edit_new.gif" CausesValidation ="false" ToolTip ="Edit Asset Type"/> </ItemTemplate> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> </asp:TemplateField> <asp:TemplateField HeaderText="Delete"> <ItemTemplate > <asp:ImageButton ID="imgbtnDelete" runat ="server" CommandArgument ='<%#Eval("AssetTypeId") %>' CommandName ="DeleteAssetType" ImageUrl ="../_img/ico_del_new_on.gif" CausesValidation ="false" OnClientClick="if (!confirm('Do you want to delete this user ?')) return false;" ToolTip ="Delete Asset Type"/> </ItemTemplate> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> </asp:TemplateField> </Columns> <FooterStyle BackColor="White" ForeColor="#000066" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> <PagerSettings Position="TopAndBottom" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <RowStyle ForeColor="#000066" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> </asp:GridView>
protected void Page_Load(object sender, EventArgs e) { try { if (Session["Username"].ToString() != "" && Session["Username"] != null && Session["Role"].ToString() != "" && Session["Role"] != null && Session.Count != 0) { if (!IsPostBack) { FillGDVAssetTypes(); } } else { Response.Redirect("../Login.aspx"); } } catch { Response.Redirect("../ErrorPage/Error.aspx"); } finally { } //AssignRights(); }
gdvAssetType_RowCommand
FillGDVAssetTypes();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)