I've always thought that server-side code is unaffected by the browser requesting it, but I've just come across an exception:
I have a button that when clicked, changes the button's CSS class (and those relative to it) and rebinds a GridView with new data. The function is this:
Private Sub lbViewUnUsed_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbViewUnUsed.Click
lbViewUsed.CssClass = "button small"
lbViewUnUsed.CssClass = "button small selected"
BindUsage(UsageBinding.UnUsed)
End Sub
In IE, this works perfectly. However, in Firefox, the BindUsage()
function stops firing midway and nothing gets accomplished at all! In my frustration, I inserted Debug.Assert()
statements after every line of code in the BindUsage()
to see what was going on, and sure enough, the function would not go all the way through in Firefox ONLY.
The BindUsage()
function is this (with the Debug assertions still in):
Private Sub BindUsage(ByVal bindWhat As UsageBinding)
Debug.Assert(False, 1)
If bindWhat = UsageBinding.Used Then
gvUsage.DataSource = sUser.GetWordsMarkedWithUsage(True)
gvUsage.Columns(0).Visible = False 'hide button column'
Else
Debug.Assert(False, 2)
gvUsage.DataSource = sUser.GetWordsMarkedWithUsage(False)
Debug.Assert(False, 3)
Dim userInfo As UserAccount.LoginInfo = UserAccount.GetUserLoginInfo
Debug.Assert(False, 4)
Dim showUsedButton As Boolean
Debug.Assert(False, 5)
showUsedButton = (userInfo.UserName.ToLowerInvariant = sUser.UserName.ToLowerInvariant)
Debug.Assert(False, 6)
gvUsage.Columns(0).Visible = showUsedButton 'show button column'
Debug.Assert(False, 7)
End If
Debug.Assert(False, 8)
gvUsage.DataBind()
Debug.Assert(False, 9)
End Sub
The above function does not make it past 5 in Firefox. I'm guessing there's some sort of problem with the assignment of the showUsedButton
variable, but I can't figure out what it would be. Why would this fail only in Firefox, but not in any other browser especially since this is occurring on the server???