The Artima Developer Community
Sponsored Link

.NET Buzz Forum
A better refresh button for asp.net pages

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Peter van Ooijen

Posts: 284
Nickname: petergekko
Registered: Sep, 2003

Peter van Ooijen is a .NET devloper/architect for Gekko Software
A better refresh button for asp.net pages Posted: May 19, 2006 2:41 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Peter van Ooijen.
Original Post: A better refresh button for asp.net pages
Feed Title: Peter's Gekko
Feed URL: /error.htm?aspxerrorpath=/blogs/peter.van.ooijen/rss.aspx
Feed Description: My weblog cotains tips tricks and opinions on ASP.NET, tablet PC's and tech in general.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Peter van Ooijen
Latest Posts From Peter's Gekko

Advertisement

Yesterday I wrote a little post on a refresh button for asp.net pages. It worked but had jump through some hoops. To simulate a refresh it posted back to the original page which in turn redirected itself to itself. Which is a waste of resources. As Simone pointed out it should simpler; like a straight link out of the browser. He's right. I will use a server side hyperlink as that gives me the possibility to fiddle with its properties on the server.

This refresh button works just like the back button,  this one sets it's url to that of the page itself.

[ToolboxData("<{0}:MyRefreshLink runat=server></{0}:MyRefreshLink>")]

public class MyRefreshLink : HyperLink

{

 

    protected override void OnLoad(EventArgs e)

    {

        if (!Page.IsPostBack)

            base.NavigateUrl = Page.Request.Url.ToString();

        base.OnLoad(e);

    }

 

    [Browsable(false)]

    public new string NavigateUrl

    {

        get

        {

            return base.NavigateUrl;

        }

    }

}

In the back button post are instruction how to use the control in your projects.

Hope you'll like this one better.

Share this post: Email it! | bookmark it! | digg it! | reddit!

Read: A better refresh button for asp.net pages

Topic: Before you telecommute, know why telecommuting is hard Previous Topic   Next Topic Topic: [INETA] Leadership Summit at TechEd 2006 Boston

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use