Tuesday, May 30, 2006

Webride - web page discussion

Webride.org allows you to have discussions on any pages you visit on the World Wide Web. Requires JavaScript and cookies enabled to signup and login (so not fully accessible). Doesn't have a rating system though (for users or pages). Uses CAPTCHA in the signup process (so hopefully spam should not be a major problem).

jQuery is used for some of its scripting backend. Provides an API so you can integrate some aspects of it on your own site (i.e. you could include comments people have made with Webride on your own pages, rather than visitors loading the Webride site).


Tags: , ,

Friday, May 19, 2006

Free Icons

There is also a list that is updated @ MaxPower - Free! Icons for your website or application

There probably are more sites with free icons, which I will try to add if I find them. Tutorial on creating your own icons with GIMP: GIMP - Creating Icons.


Tags: , ,

Wednesday, May 17, 2006

FixListControl - select correct item on PostBack for CheckBoxList/DropDownList/ListBox/RadioButtonList (ASP.NET)

When you add a DropDownList (or any other web controls that inherit from ListControl) to a page and bind it on page load, the first value ends up being selected (or to be more accurate, no value gets selected, so by default the first item is shown) on PostBack (rather than the one you selected). One solution to this is to check if a PostBack has occured and only set up the DropDownList on initial page load.

private void Page_Load(object sender, EventArgs e)
{
 if(!IsPostBack)
 {
  SetupMyDropDown();
 }
}

This helps in most cases, but not if you do a DataBind for the whole page.

private void Page_Load(object sender, EventArgs e)
{
 if(!IsPostBack)
 {
  SetupMyDropDown();
 }
 BindData();
}

This could cause a "Object reference not set to an instance of an object" error, because your DropDownList is bound to an object that needs to be set up on each page load (it is not persisted in view state). One solution would be to bind everything but the DropDownList, but that would not be viable if you needed to bind the whole page (e.g. in your HTML you had <title><%# PageTitle %></title>.

Another solution would be to change the selected value before the page renders. The following method does this (and only if the user is posting back).

private void InitializeComponent()
{
 this.Load += new EventHandler(this.Page_Load);
 this.MyDropDown.PreRender += new EventHandler(this.FixListControl);
}
private void FixListControl(object sender, EventArgs e)
{
 if(IsPostBack)
 {
  ListControl l = (ListControl)sender;
  l.SelectedValue = Request.Form[l.ClientID];
 }
}

Very little code is needed and you can use it for anything that inherits from ListControl, so the following should work as well (I have only tested it with DropDownList):

this.MyCheckBoxList.PreRender += new EventHandler(this.FixListControl);
this.MyDropDown.PreRender += new EventHandler(this.FixListControl);
this.MyListBox.PreRender += new EventHandler(this.FixListControl);
this.MyRadioButtonList.PreRender += new EventHandler(this.FixListControl);

Tags: , , , , , , ,

Friday, May 12, 2006

Lots of free software for almost any purpose

You can do just about anything with free software (freeware or open source). eConsultant has a big list: I want a Freeware Utility to ... 450+ common problems solved (does not include open source in the list). There is a seperate list for open source: Open Source Freeware : 400+ free applications and utilities


Tags: , ,

Friday, May 05, 2006

Direct Manipulation Using JavaScript and CSS

ToolMan DHTML Library is a useful JavaScript library that allow you to: drag and drop, sort (lists and toolbars) and edit in place (edit content by double clicking on it in the page).


Tags: ,

A Multipart Series on ASP.NET 2.0's Membership, Roles, and Profile

From 4GuysFromRolla.com. 4 parts so far. And a feed of the series.

  • Part 1 - membership basics, a look at the SqlMembershipProvider class.
  • Part 2 - creating roles and assigning to users.
  • Part 3 - adding membership related schemas to a SQL database using aspnet_regsql.exe.
  • Part 4 - show messages to users who cannot login (i.e. why they can't), keep log of login failures.

Tags: ,