PAGE META REFRESH

I have the following page that is filtered by a dropdown mention by "Station".   I need help refrshing back to itself
with the page diplayed after the filter is applied.   I have been using Meta Refresh; however, this is not taking the filter into consideration.   In other words I need the page to refresh to the Station filter that has been already applied.

Here is the code for the page with the Meta Refesh inserted into the head.  


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Home1.aspx.cs" Inherits="_Home1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">

<meta http-equiv="REFRESH" content="30"/>

<title>LAS Home</title>
<style type="text/css">
.style3 {
	text-align: left;
}
.style5 {
	border-color: #c0c0c0;
	border-width: 0;
	background-color: #ffffff;
}
.style6 {
	text-align: center;
	color: #0000FF;
	font-family: Arial;
}
.style16 {
	font-size: small;
	color: #000080;
}
.style17 {
	font-family: Arial;
}
</style>
</head>

<body>

<form id="form1" runat="server">
	<div class="style3">
	<table style="width: 1230px" cellpadding="0" cellspacing="0" class="style5">
		<tr>
			<td class="style6"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			Station Level - System Critical Workload and AOS Activity 
			Planner&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</strong></td>
		</tr>
		<tr>
			<td style="height: 19px"></td>
		</tr>
		<tr>
			<td valign="top" class="style3">
		<div class="style3">
			<span class="style16">
			
<form name="form1">

Open in new window

BOEING39Asked:
Who is Participating?
 
Carlos VillegasConnect With a Mentor Full Stack .NET DeveloperCommented:
Hello, I have made this example for you, I uses javascript to refresh the page every 30 seconds, the auto refresh is enabled when you select a station from the dropdownlist, here the aspx code:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        EnableAutoRefresh();
        Label1.Text = DateTime.Now.ToString();
    }

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        EnableAutoRefresh();
    }

    void EnableAutoRefresh()
    {
        // Enable only if there is a filter applied.
        if (DropDownList1.SelectedIndex == 0)
            return;

        if (!ClientScript.IsStartupScriptRegistered("startAutoRefresh"))
            ClientScript.RegisterStartupScript(this.GetType(), "startAutoRefresh", "startAutoRefresh();", true);        
    }
    
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function startAutoRefresh() {
            window.setTimeout('<%= form1.ClientID %>.submit();', 30000);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
        <asp:ListItem Value="0" Text="Select a Station"></asp:ListItem>
        <asp:ListItem Value="1" Text="Station 1"></asp:ListItem>
        <asp:ListItem Value="2" Text="Station 2"></asp:ListItem>
        <asp:ListItem Value="3" Text="Station 3"></asp:ListItem>
        <asp:ListItem Value="4" Text="Station 4"></asp:ListItem>
        </asp:DropDownList>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>

Open in new window

And here the aspx file if your prefer it:
Test9.aspx
0
 
BOEING39Author Commented:
Works great Thank You
0
 
Carlos VillegasFull Stack .NET DeveloperCommented:
Glad to help buddy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.