Good morning,
I have been researching this issue and have not been able to figure out the solution and was wondering if you could shed some light on the correct settings for your datagrid.
I have a main asp.net page that opens via javascript a modal (using window.showModalDialog) .aspx page. I perform the necessary database updates from the modal window and have verified that the changes to the DB have been commited and the datagrid reflects the changes, etc. The datagrid is contained inside a callback panel. If I close out the modal window and then go back into the modal window the datagrid reverts back to the original dataset and does not reflect the new changes to the database. I have debugged the code and it is correctly executing
Code: Visual Basic.NET
Dim dsPhones As New DataSet
dsPhones = PropertyInfo.getPropertyPhones(asPropertyID)
If dsPhones.Tables(0).Rows.Count >= 1 Then
Dim drPropertyInfo As DataRow = dsPhones.Tables(0).Rows(0)
lblProperty.Text = "Phone Numbers for " + drPropertyInfo.Item("prop_nm").ToString.Trim
grdPhones.Items.Clear()
grdPhones.DataSource = dsPhones
grdPhones.DataBind()
Else
lblProperty.Text = "Phone Numbers have not been assigned to this Property."
End If
I have tried clearing the viewstate for the modal aspx page, but that does not seem to work. I have traced the viewstate and found that the viewstate for a modal window is contained inside the main window that opened the modal so clearing out the viewstate at the modal window does not have any affect on the datagrid. I know the datagrid is working correctly because if I open the window as a popup (using window.open) via javascript, the datagrid refreshes correctly everytime.
I have changed the javascript code to use the window.open where it makes sense, but there are a couple of instances where I need to use the window.showModalDialog.
Any suggestions would be greatly appreciated.