Home » 2012 » January

Archive for January, 2012

VB.NET – Limited user (checkbox) selection

I found this script very helpful while designing surveys for my organization. This post applies to: – MS SQL server 2005+ – VB.NET – VS2010 – .NET 4.0 Framework Javascript code <asp:content ID=”Content1″ ContentPlaceHolderID=”HeadContent” Runat=”Server”> <script type=”text/javascript” language=”javascript”> function CheckCheck() { var chkBoxList = document.getElementById(‘< %=CheckBoxList1.ClientID %>’); var chkBoxCount = chkBoxList.getElementsByTagName(“input”); var btn = document.getElementById(‘< […]

Delete confirm javascript

<a href=”default.asp?do=del&rid=<%= objRS(“ID”) %>” onclick=”return confirm(‘Are you sure you want to delete?’)” >Delete</a>

VB.NET – SQL statement “LIKE”

Input box Please enter customer first or last name: <asp:RequiredFieldValidator ID=”ReqSearchfor” runat=”server” ErrorMessage=”<font color=’red’>Input box can not be empty!</font>” ControlToValidate=”SearchFor” > <asp:TextBox ID=”SearchFor” runat=”server”> <asp:Button ID=”SearchBtn” runat=”server” Text=”Search” /> SQL DataSource Design <asp:SqlDataSource ID=”SearchResults” runat=”server” ConnectionString=”< %$ myConString %>” SelectCommand=”SELECT * FROM [CustomerTbl] WHERE ([customer_name] LIKE ‘%’ + @customer_name + ‘%’)” <SelectParameters> <asp:ControlParameter ControlID=”SearchFor” Name=”customer_name” […]