Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / ASP.NET

Creating a Delayed Postback

3.00/5 (2 votes)
24 May 2011CPOL 12.1K  
Especially as the use of JQuery grows, there may be time when you'll want a postback to occur but not right away, especially if you want to animate something on the browser first.
Server Code: (VB, roll your own semicolons)
VB
Protected PostBackStr As String
PostBackStr = Page.ClientScript.GetPostBackEventReference(Me, "MyCustomArgument")


Client Code:
HTML
setTimeout("<%= PostBackStr %>", 1000);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)