Home » 2011 » May

Archive for May, 2011

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 […]

Classic ASP – Date and time formating

Code <script type=”text/vbscript”> document.write(DateAdd(“yyyy”,1,”31-Jan-10″) & “”) document.write(DateAdd(“q”,1,”31-Jan-10″) & “”) document.write(DateAdd(“m”,1,”31-Jan-10″) & “”) document.write(DateAdd(“y”,1,”31-Jan-10″) & “”) document.write(DateAdd(“d”,1,”31-Jan-10″) & “”) document.write(DateAdd(“w”,1,”31-Jan-10″) & “”) document.write(DateAdd(“ww”,1,”31-Jan-10″) & “”) document.write(DateAdd(“h”,1,”31-Jan-10 08:50:00″) & “”) document.write(DateAdd(“n”,1,”31-Jan-10 08:50:00″) & “”) document.write(DateAdd(“s”,1,”31-Jan-10 08:50:00″) & “”) </script> Output 1/31/2011 4/30/2010 2/28/2010 2/1/2010 2/1/2010 2/1/2010 2/7/2010 1/31/2010 9:50:00 AM 1/31/2010 8:51:00 AM 1/31/2010 8:50:01 AM