在特定时间后刷新页面 [英] getting page refresh after specific time

查看:68
本文介绍了在特定时间后刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,


当我想自动刷新页面的时候,我在下面放置了一行

Response.AppendHeader("Refresh", "30");

在我的页面加载事件中.
但现在我不想刷新页面以便我评论该行
但我的页面仍在特定时间后回发.

所以请告诉我该怎么办


谢谢...

Dear All,


when I wanted to automatic refresh page that time i putted a line as below

Response.AppendHeader("Refresh", "30");

in my page Load event.
but now I don''t want to refresh page so that i comment that line
but still my page getting postback after specific time.

so please tell me what can i do for this


thanks...

推荐答案

您重新发布网站了吗?
您是否在其中放置了另一个AppendHeader?

抱歉,但是只有这么少的信息,我们只能猜测.
Did you republish your website?
Did you put another AppendHeader in there?

Sorry, but with that little information, we can only guess.


感谢您的回复

亲爱的先生


这是我的代码

thanks for response

dear sir


this is my code

protected void Page_Load(object sender, EventArgs e)
    {

        try
        {


//Response.AppendHeader("Refresh", "30");

            hdShowWeather.Value = "False";
            _vpath = UtilityLibrary.Helper.GetVirtualPath();
            //dvDuplicateEmailMessage.Visible = false;
            lblNoOffer.Visible = false;
            ((HtmlAnchor)(Master.FindControl("aHome"))).Attributes.Add("class", "top_menu_active");
            ((HtmlAnchor)(Master.FindControl("aHome"))).HRef = "#";
            ((TextBox)Master.FindControl("txtUsrNm")).Focus();
            m_UserDetails = m_CookieInfo.Split('';'');

            //Added by Amol to Show Friends list on Home page starts
            if (!string.IsNullOrEmpty(m_CookieInfo))
            {
                m_LoginUserID = Convert.ToInt32(m_UserDetails[1]);
                m_QueryUserID = Convert.ToInt32(Request.QueryString.Get("ProfileID"));
                ShowLinks();
                AssignLinks();
                SetControlAttrib_NetworkList();

            }
            //Added by Amol to Show Friends list on Home page ends

            if (!IsPostBack)
            {
                ImageGalleryHandler images = new ImageGalleryHandler();
                dtlstImages.DataSource = images.LoadHomePageImagesList<IDataReader>();
                dtlstImages.DataBind();
                UserInfoHandler m_UserInfoHandler = new UserInfoHandler();
                DlstLatestMember.DataSource = m_UserInfoHandler.FetchLatestMember<IDataReader>();
                DlstLatestMember.DataBind();
                // m_userId = (HttpContext.Current.User.Identity.Name.Split('';'')[1]);   
                //divIndName.Visible = true;
                //divOrgName.Visible = false;


            }
            if (string.IsNullOrEmpty(m_CookieInfo))
            {
                pnl_Home.Visible = true;
                pnl_MyHome.Visible = false;
                aWeatherLogo.HRef = "http://www.weather.com";
                //tdFriends.Visible = false;
            }
            else
            {
                m_LoginUserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name.Split('';'')[1]);
                pnl_MyHome.Visible = true;
                pnl_Home.Visible = false;
                //Added by manoj to remove log4.txt error
                //if (m_LoginUserID != null)
                //{
                AssignProfileValues(m_LoginUserID);
                //}

                PersonalInfoHandler prsnl = new PersonalInfoHandler();
                if (!String.IsNullOrEmpty(stationId))
                {
                    weatherCode = prsnl.WeatherStationCode(stationId);
                    aWeatherLogo.HRef = "http://www.weather.com/weather/today/" + weatherCode;
                }

                //aUserImage.HRef = String.Concat(_vpath, Helper.GetValue(Constants.APPKEYS.VIEWPROFILE), "?ProfileID=", m_LoginUserID);
                //Added by manoj for notifiation

                if (!IsPostBack)
                {
                    LoadAlertData();
                    GetAllCountries();
                    GetAllWeatherStationsByCountry(int.Parse(drpdwnlstcountry.SelectedValue));

                    if (!string.IsNullOrEmpty(m_LoginUserID.ToString()) && m_LoginUserID != 0)
                    {
                        fillNotificationData();

                        aImportContacts.HRef = String.Concat(_vpath, Helper.GetValue(Constants.APPKEYS.INVITEFRIENDS), "?ProfileID=", m_LoginUserID);
                        aImgImportContacts.HRef = String.Concat(_vpath, Helper.GetValue(Constants.APPKEYS.INVITEFRIENDS), "?ProfileID=", m_LoginUserID);
                        aInviteFriends.HRef = string.Concat(_vpath, "/Invite/Invite.aspx", "?ProfileID=", m_LoginUserID);
                        aImgInviteFriends.HRef = string.Concat(_vpath, "/Invite/Invite.aspx", "?ProfileID=", m_LoginUserID);
                    }
                }
            }
            if (!string.IsNullOrEmpty(m_CookieInfo))
            {
                SetControlAttrib_ContactList();
            }
        }

        catch (Exception ex)
        { ((HtmlTableCell)(Master.FindControl("tdError"))).InnerText = m_ExcHndlr.HandleException(ex); }


    }






现在我已经从代码中删除了该注释行,但仍然可以发回邮件






and now i have removed that commented line from my code but still getting post back


这篇关于在特定时间后刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆