?
Solved

PAGE META REFRESH

Posted on 2011-10-22
3
Medium Priority
?
359 Views
Last Modified: 2012-05-12
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

0
Comment
Question by:BOEING39
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Carlos Villegas earned 2000 total points
ID: 37011927
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
 

Author Closing Comment

by:BOEING39
ID: 37042210
Works great Thank You
0
 
LVL 17

Expert Comment

by:Carlos Villegas
ID: 37042580
Glad to help buddy
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question