Home » Applications » Archive by category "ASP.NET" (Page 23)

Archive for the 'ASP.NET' Category

Block Access To Page Context Menu

By Stephen Chapman Web novices often believe that by blocking their visitors use of the right mouse button that they can prevent the theft of their web page content. Nothing could be further from the truth as there are so many ways to bypass the “no right click script” that the only effects that such […]

GridView drop-down list record update:

Found this code on msdn library and use it all the time. Code is pretty straight forward and easy to implement and customizable. Have fun using it. <asp:TemplateField SortExpression=”CategoryName” HeaderText=”CategoryName”> <EditItemTemplate> <asp:DropDownList ID=”DropDownList1″ Runat=”server” DataSourceID=”categoryDataSource” DataTextField=”CategoryName” DataValueField=”CategoryID” SelectedValue='<%# Bind(“CategoryID”) %>’> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label Runat=”server” Text='<%# Bind(“CategoryName”) %>’ ID=”Label1″></asp:Label> </ItemTemplate> </asp:TemplateField> For more related code […]

One click gridview record update

Here is how you can update record in a gridview with just a one click. Code: <asp:TemplateField HeaderText=”Active”> <ItemTemplate> <asp:CheckBox ID=”ActiveCheckBox” runat=”server” Checked='<%# Bind(“Active”) %>’ /> <asp:LinkButton ID=”UpdateButton” runat=”server” CausesValidation=”True” CommandName=”Update” Text=”Update” /> </ItemTemplate> <HeaderStyle CssClass=”datagrid-th” /> </asp:TemplateField> Access Data Source <asp:AccessDataSource ID=”RepoMgt” runat=”server” DataFile=”/my_folder/mydb.mdb” DeleteCommand=”DELETE FROM [MyCars] WHERE [ID] = ?” InsertCommand=”INSERT INTO [MyCars] […]