views:

54

answers:

2

How to refresh a page from another page in asp.net?I have one page called Common.aspx.Once i click some button another page(Company.aspx)should refresh.How It possible?

If Not ClientScript.IsStartupScriptRegistered("ReloadPage") Then ScriptManager.RegisterStartupScript(?,Me.GetType(), "ReloadPage", "ReloadPage();", True) End If

Here ReloadPage Function in company.aspx.I am wrting this code in Common.aspx.It is possible to call?What i should write in ? Portion....

+1  A: 

You will need Company to poll the server somehow.

This can be done using Ajax and a javscript timer.

First have Company.aspx check for a session variable on the server on the javascript timer interval events. You can do a full Postback if the variable is set to some value you've previously chosen.

Now have Common.aspx set that Session variable when you want to.

kervin
A: 

The answer depends on how those pages are related. I guess that one of them opened the other, so if common.aspx launches company.aspx then you must get a handle of the opened window (the returned object of window.open)

var companyWindow = window.open('company.aspx'...

and do

companyWindow.location.href = companyWindow.location.href

It common is launched by company then use window.opener. But this of course works only if you can control the window.open call. If you can't then you must work on the solution by kervin

AlfonsoML