Protected Sub btnGetData_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnGetData.Click
LoadGridView()
ForcePageRefresh()
End Sub
Sub ForcePageRefresh()
Dim popupScript As String
Dim instance As ClientScriptManager
instance = Page.ClientScript
popupScript = "<script language='JavaScript'>"
popupScript = popupScript & "
window.location.reload( true );"
popupScript = popupScript & "</script>"
instance.RegisterStartupScript(GetType(String), "PopupScript",
popupScript)
End Sub
for either approach to work you shoudl decorate the url (add a dummay
parameter) to force a fresh copy rather than using a cached copy.
-- bruce (sqlwork.com)
Hi
I am intrigued as to why you want to do this. Could it be that you are
trying to trigger execution of code on the host page when a User
Control button is clicked?
<COHEN...@lycos.com> wrote in message
news:8e704703-6ad0-4851...@y21g2000hsf.googlegroups.com...
The reason I wanted to force a refresh was that I noticed my gridview
was only showing up when the page was refreshed. It wasn't enough to
set its parameters and then do a 'databind' - the gridview would only
appear on a postback. I really don't understand why this is the case,
and even when I stepped through with the debugger everything seemed in
order - but the gridview would not appear. So I decided to cheat, and
force a refresh.
The page does use AJAX, and perhaps that has some bug that causes the
problem.
-- Marvin