In the below code I take a string and split it, then assign it to a "Label" object.
On my computer it works great but when I "Publish web site" I recieve the .NET error messages "Object reference not set to an instance of an object" and "Index was outside the bounds of the array".
Any idea how to fix it? I've tried in so many ways...
Dim GetPhoneString As String = GetStr("abcd") If GetPhoneString.Length < 1 Then lbl1.Text = "N\A" lbl2.Text = "N\A" lbl3.Text = "N\A" lbl4.Text = "N\A" Else Dim MapPhoneData As String() = Split(GetPhoneString, ",") lbl1.Text = MapPhoneData(0) lbl2.Text = MapPhoneData(1) lbl3.Text = MapPhoneData(2) lbl4.Text = MapPhoneData(3) End If