.NET Execution Order

Posted in C# Programming, VB .Net Programming on June 6th, 2010 by phoenixdigital

When a page is loaded the execution order is


Page_Init(object sender, EventArgs e) {}
Page_Load(object sender, EventArgs e) {}
Page_DataBind(object sender, EventArgs e) {}
Page_PreRender(object sender, EventArgs e) {}
Page_Unload(object sender, EventArgs e) {}

http://support.microsoft.com/kb/305141

Tags:

Adding indentation and headings to .NET DropDownList

Posted in C# Programming, VB .Net Programming on April 21st, 2010 by phoenixdigital

I have been able to add indentation to dropdown boxes to allow for easier user viewing in many languages… until I met .NET. For some reason when adding spaces to the text in a ListItem the spaces are magically removed.

I was wanting to acheive a DropDownList like below.

Also at the end of this post is a way to achieve the unselectable headings in the example above.

Read more »

Tags: , , , , , , ,

Testing on multiple IE versions

Posted in C# Programming, JQuery, PHP Programming, VB .Net Programming on February 3rd, 2010 by phoenixdigital

Handy little program to test on the various versions of IE

IE Tester

Sure to cause no end of frustration getting layouts to look the same in all versions.

Tags: , , , ,

Style missing from AjaxToolkit Tab Container

Posted in C# Programming, VB .Net Programming on December 1st, 2009 by phoenixdigital

If you notice the style is missing from your AjaxToolkit Tab Container. It could be due to the fact that when your page first loads this element is not visible either due to a surrounding div not being visible. This may cause the stylesheet for the Tab container not to load on subsequent postbacks when you make the Tab Container visible.
Read more »

Tags: , , ,

.Net Maintain Page Position on Postback

Posted in C# Programming, VB .Net Programming on September 1st, 2009 by phoenixdigital

A simple but useful option for .NET pages which will keep your position for postback. Place the following in the page definition.

MaintainScrollPositionOnPostback=”true”

C# Repeater Bindings to SQL and Objects

Posted in C# Programming, VB .Net Programming on August 27th, 2009 by phoenixdigital

For a dataset from SQL the below will retrieve the field from the resultset called ‘Name’
<%#DataBinder.Eval(Container.DataItem, "Name")%>

For a list the below will retrieve the member variable Fred from each of the objects appears to work for ASP.NET
<%#Container.DataItem.Fred%>

or for C#
<%#Eval("name")%>
Remember your class must define getters and setters
public string name { get; set; }

For Each Loop Code Examples

Posted in C# Programming, iPhone Programming, Multi Language Examples, PHP Programming, VB .Net Programming on July 20th, 2009 by phoenixdigital

This post continues with examples in multiple languages of various coding routines. It’s goal is to assist someone transitioning from one language to another.

In this example we cover the for each loop.
Read more »

If Else Code Examples

Posted in C# Programming, iPhone Programming, Multi Language Examples, PHP Programming, VB .Net Programming on July 19th, 2009 by phoenixdigital

This post continues with examples in multiple languages of various coding routines. It’s goal is to assist someone transitioning from one language to another.

In this example we cover the if else commands.
Read more »

Switch and Case Code Examples

Posted in C# Programming, iPhone Programming, Multi Language Examples, PHP Programming, VB .Net Programming on July 19th, 2009 by phoenixdigital

This post continues with examples in multiple languages of various coding routines. It’s goal is to assist someone transitioning from one language to another.

In this example we cover the switch case conditional statement. This statement is frowned upon by some programmers but can make a cascade of if else statements alot easier to understand.
Read more »

Do Loops Code Examples

Posted in C# Programming, iPhone Programming, Multi Language Examples, PHP Programming, VB .Net Programming on July 19th, 2009 by phoenixdigital

This post continues with examples in multiple languages of various coding routines. It’s goal is to assist someone transitioning from one language to another.

In this example we cover the simple do loop.
Read more »