Click here to Skip to main content
15,881,248 members
Articles / Web Development / ASP.NET
Tip/Trick

Creating a Delayed Postback

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
24 May 2011CPOL 11.9K   1  
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)


Written By
Bad
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --