So I have a grid inside an asp update panel. I have a dropdown list with differnet cultutres on the master page. In the need data source event handler for the grid, I check the value of the dropdown like so
Protected Sub grid_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grid.NeedDataSource
PopulateGrid(False)
Dim ddl As New DropDownList()
Dim strLanguage As String
ddl = CType(Me.Master.FindControl("ddlLanguage"), DropDownList)
strLanguage = ddl.SelectedValue
If strLanguage Is Nothing Or strLanguage.Length = 0 Then
strLanguage = "en-US"
End If
Dim newCulture As CultureInfo = CultureInfo.CreateSpecificCulture(strLanguage)
gridVirtualPoints.Culture = newCulture
End Sub
Here is the PopulateGrid method called in the first line of the above method
Private Sub PopulateGrid(ByVal reload As Boolean)
If CurrentUser.isAdmin Or CurrentUser.isParent Then
Dim Customers = dal.SelectCustomersByCustomerID(CurrentCustomer.CustomerID)
Dim CustomerIDs As New List(Of String)
For Each Customer As Customer In Customers
If Not Customer Is Nothing Then
CustomerIDs.Add(Customer.CustomerID)
End If
Next
//this just gets the data from the database
grid.DataSource = dal.getgriddata(CustomerIDs)
Else
grid.DataSource = dal.getgriddata(CurrentUser.UserID)
End If
If reload Then
grid.DataBind()
End If
End Sub
When I change the dropdown from the masterpage to a different language, it changes all the other values in the resx file except the page text. The really weird part is, if I change the dropdown value again it then updates the pager text to what it should have been the first time. So in other words
1. change from english to french. All the text from the resx file EXCEPT the PagerText changes.
2. Change back to English. All the text from the english rex file change correctly, and the pagertext now changes to the french pager text from the resx file.
Could this have something to do with the asp update panel?