Question String.IsNullOrEmpty???

Jamie2993

Member
Joined
May 13, 2009
Messages
11
Programming Experience
1-3
Hi All,

I'm trying to create a homepage feature for my program and cant seem to get it to check is its Empty or only contains spaces etc...

ive done this to make it navigate but doesnt check

If String.IsNullOrEmpty(My.Settings.homepage) Then
wb.Navigate2("http://google.co.uk")
Else
wb.Navigate2(My.Settings.homepage)
End If

^ that doesnt seem to work when form1.load

this is code for setting the homepage:

My.Settings.homepage = TextBox1.Text
My.Settings.Save()

but i have no idea how to make it check there as ive tried the IsNullOrEmpty,

Any Idea's;

Thanks In Advance,

Jamie.
 
The code looks fine to me, I don't know why it wouldn't work but you could always try it in the Shown() event.
 
I was thinking of protecting the event/control that saves this value. Say you have a button you use to save the info - keep this disabled until you have a valid address - say a Regex pattern - then they can save it.
 
Back
Top