Home » Archive by category "Applications" (Page 6)

Archive for the 'Applications' Category

Define control properties in code behind located inside gridview or formview

Markup page <asp:FormView ID=”DefaultPhoto” runat=”server” DataKeyNames=”ge_id” DataSourceID=”ListPhotosDS”> <EditItemTemplate> <img src=”/images/< %# Container.DataItem("photo") %>” class=”detailsmallphoto”/> <asp:Label ID=”photo_idLabel” runat=”server” Text=’< %# Eval("photo_id") %>‘ Visible=”false” /> <asp:LinkButton ID=”UpdateButton” runat=”server” OnClientClick=”return confirm(‘Are you sure you want to remove this photo?’);” CommandName=”Update” /> </EditItemTemplate> </asp:FormView> Code behind DirectCast(DefaultPhoto.FindControl(“UpdateButton”), LinkButton).Text = “Remove” If Page.isPostBack Then DirectCast(DefaultPhoto.FindControl(“UpdateButton”), LinkButton).Text = “Add Photo” End […]

Classic ASP Connection String

Sql connection ************************ Dim connStr connStr = “Provider=SQLOLEDB;Data Source=my-sql-server;UID=MyUsernmame; PWD=MyPassword; database=MyDatabase;” Set objConn = Server.CreateObject(“ADODB.Connection”) objConn.ConnectionTimeOut = 30 objConn.ConnectionString = connStr objConn.Open SET objRS = Server.CreateObject(“ADODB.RecordSet”) objRS.Open “SELECT * FROM my_table ORDER BY type asc”,objConn,1,2 ‘do some sql work objRS.Close SET objRS = Nothing Access 2007/2010 connection ************************ DIM objConn, objRS, dsn, dbPath dsn = […]

jQuery Datepicker

            To create jQuery Datepicker like this one below do the following: 1. Save the calendar.zip on your computer 2. Unzip the folder and move it to your server 3. Include the js scripts and css style in your page: – <script src=”/my-website/jcalendar/jquery-1.8.3.js” type=”text/javascript”></script> – <link href=”/my-website/calendar/jquery-ui.css” rel=”stylesheet” type=”text/css” /> […]