Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Simple code bittie to greatly improve the DotNetNuke Registration form

Since I have to require site registration for readers to use Comment Notification, I wanted to eliminate the frustration I always have when I use the DNN Registration Form.

That frustration is when I fire up the form, I don't want it to default to JAPAN as the country, then select “U” and have UGANDA displayed, requiring 3 or 4 keystrokes downward to find UNITED STATES, then an autopostback, and you can select your state.  I looked for a DNN Host or Admin Site Settings option to change the default, but I didn't see any.  So instead of doing exploratory code surgery I added a couple lines of code to default the country dropdown to UNITED STATES, with the STATE dropdown ready for action.

in /controls/address.ascx.vb

Select Case LCase(_CountryData)
Case "text"
    If Not cboCountry.Items.FindByText(_Country) Is Nothing Then
 cboCountry.ClearSelection()
 cboCountry.Items.FindByText(_Country).Selected = True
    Else
 'DBVT Code Begin
 cboCountry.ClearSelection()
 cboCountry.Items.FindByText("United States").Selected = True
 'DBVT Code End

    End If
Case "value"
    If Not cboCountry.Items.FindByValue(_Country) Is Nothing Then
 cboCountry.ClearSelection()
 cboCountry.Items.FindByValue(_Country).Selected = True
    End If
End Select

 

Comments (2) | Post RSS RSS comment feed

Posted on 9/28/2004 10:19:00 PM by Dave Burke
Categories:
Tags:

Related posts

Comments (2) -

11/22/2005 11:01:23 AM Permalink

Hi Dave; I'm having an issue all of a sudden where the default country is CANADA for some reason, it used to always be US. May I ask why your particular app was defaulting to Japan? Thanks

Larry B |

11/22/2005 11:11:05 AM Permalink

Larry,  I don't remember if it WAS Japan, sorry.  I just remember it being a pain and that I would have thought it should have defaulted to US or had an admin setting to set the default.  That was with DNN 2.x, btw.  I hope that issue doesn't happen with DNN3, since I have to put up a couple DNN3 sites soon.  Thanks.

daveburke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke