Archive for August, 2008
For those who do not want to mess with PHP code . Here is an easy way to add Google Analytics in wordpress. 1. Download the plug in from http://yoast.com/wordpress/google-analytics/ 2. copy it to your plug ins folder 3. If you already don’t have an account, create one free account at www.google.com/analytics 4. Add your [...]
August 28th, 2008 | Posted in Wordpress | 5 Comments
Suppose you have a label control name lblMessage in your masterpage and you want to access the label control from one of your pages, you can do so using the following code Ctype( Page.Master.FindControl(“lblMessage”),Label).Text = “Hello”
August 25th, 2008 | Posted in Code snippets | 1 Comment
Many people have problems inserting flash files in masterpages . The following code is the correct way of inserting flash file in a mastepage . It will work in all situations <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase= “http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0″ width=”663″ height=”105″ title=”Serious Reading….”> <param name=”movie” value=’<%= Request.ApplicationPath + “main_anim.swf” %>’ <param name=”quality” value=”high” /> <embed src=’<%= Request.ApplicationPath + “main_anim.swf” [...]
August 25th, 2008 | Posted in Code snippets | 7 Comments
Here are a few basic tips for on page search engine optimisation that i try to implement in all my websites. 1. The page title gets top priority. It should be short. Only your main keywords should be in the title. Eliminated all unwanted words. Replace the word “and” with | so that you can [...]
August 25th, 2008 | Posted in SEO, Tutorials | No Comments
To format a gridview column to display dates properly , two properties needs to be changed, the DateFormatString property and the HTML encode property. After setting the DateFormatString the HTMLEncode property should be set to false. For Example : <asp:BoundField DataField=”RegistrationDate” DataFormatString=”{0:MM/dd/yyyy}” HeaderText=”Date” HtmlEncode=”False” SortExpression=”RegistrationDate” />
August 25th, 2008 | Posted in Code snippets | No Comments
In some scenarios you may only want users of a particular role to delete records from the GridView. So you need a mechanism to disable/hide the delete link in the gridview based on roles. The code below will enable the delete link only for “Admin” roles and disable it for the rest. Protected Sub gridView1_RowDataBound(ByVal [...]
August 25th, 2008 | Posted in Code snippets | 1 Comment
Most web hosts provide more mySQL databases than SQl Server 2005 database. To keep your hosting costs low , you might need to use MySQL in your projects. To connect to MySQL database First download the drivers here Then copy MySql.Data .dll and MySql.Web.dll to your bin directory The connection string is as follows <add [...]
August 25th, 2008 | Posted in Tutorials | No Comments
<%=ServerControlID.ClientID%> Yes that’s all you need . For Example suppose you have a asp.net textbox server control whose ID is “Textbox1″ . In your javascript code to get the value of the control you will use something like this var myValue= document.getElementById(‘<%=TextBox1.ClientID%>’).value;
August 25th, 2008 | Posted in Code snippets | 2 Comments
I have been working ASP and ASP.NET since almost a decade back. Here I would just like to put down some stuff which I had difficulty finding the answers to. Hope it helps some guys looking for answers
August 25th, 2008 | Posted in Uncategorized | No Comments
I found a nice and simple control Artem Google Map control . Its free, very simple to use and instructions are clearly provided . Just download the control file and put it in your bin directory. Sign up for a new Google Map key and note down the key. Here is an example of using [...]
August 25th, 2008 | Posted in Free ASP.NET controls, Uncategorized | 13 Comments