tags:

views:

49

answers:

4

On buttonSave click after saving the record successfully ,I want to show “Save successfully “ message on a label on a page for few seconds and then reload the page. Thanks in Advance

+1  A: 

You can add a META refresh tag:

<meta http-equiv="refresh" content="5;url=SomeURL">
SLaks
Shoban - Read my question carefully, before making any comments
A: 

I don't know about ASP, yet I'll tell you a simple idea, you can use timers, and add a trigger to the timer as when the timer is out, the trigger is fired. Hope I have helped you ...

sikas
Actually, you can't.
SLaks
A: 

You can do this using the 'meta' tag. This will reload the page after 3 seconds:

<meta http-equiv="refresh" content="3">

To do this in code, you can do something like this in your submit event (C# syntax but it should be easy enough to understand):

HtmlMeta meta = new HtmlMeta()
{
    HttpEquiv = "refresh",
    Content = "3"
};

Page.Header.Controls.Add(meta);

For this to work, you need to have a <head runat="server"> on the page.

richeym
How do I do this on a userControl? which is loaded on content page?
Not sure I follow, the code should work from within a user control too.
richeym
It did not work.
A: 

You can show a nice overlay busy message.

The Mark-up part:

$(function() { // when document has loaded

    ($.unblockUI); //unlock UI

    //Show busy message on click event and disable UI
    $('#btnHelloWorld').click(function() {
    $.blockUI({ message: '<h4><img src="busy.gif" />Please wait...</h4>' });

    });

});

<asp:Button ID="btnHelloWorld" runat="server" Text="Hello World" /><br/>

The Code behind:

   Protected Sub btnHelloWorld_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnHelloWorld.Click
        Label1.Text = "Hello World"
        Threading.Thread.Sleep(5000)
    End Sub

Check out jQuery BlockUI Plugin

Angkor Wat