1.First open a new WebSite in VS studio and create two aspx web pages as Sample1.aspx and Sample2.aspx.
2.Let Sample2.aspx be a popup window and Sample1.aspx is a normal webpage.
Write the below in the heag tag of the Sample2.aspx which page to be loaded.
<html>
<head>
<script language="javascript">
function Refresh()
{
__doPostBack('btnClick',' ');
location.reload();
}
<script>
4.In the pop up window if we have a button,the write the below code as follows:
<script language="javascript">
function Refresh()
{
__doPostBack('btnClick',' ');
location.reload();
}
<script>
<head>
<html>
3.Write the following code in the normal sample1.aspx page where u want to load the pop up window.
protected void Page_Load()
{
if (IsPostBack)
{
string arg = Request.Form["__EVENTTARGET"];
string val = Request.Form["__EVENTARGUMENT"];
if (arg == "btnClick")
{
//Write the code as what to populate......
}
}
4.In the pop up window if we have a button,the write the below code as follows:
protected void btnClose_Click(object sender, EventArgs e)
{
Response.Write("");
}
In this way you can use the javascript code for refreshing a page....