Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to: display page, post back, display again

Reply
Thread Tools

How to: display page, post back, display again

 
 
=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
Guest
Posts: n/a
 
      07-13-2006
Hi;

I would like to display a page then immediately cause a post back (the 1st
page will have a big "working..." on it, then in the post back do my query
which will take a couple of seconds, and then redisplay the page again.

What do I do in the first post back so the page is displayed to the user,
but I then get a post back again?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-14-2006
Hi Dave,

Thank you for your post.

Based on my understanding, your question is how to cause another postback
upon page's first load. If I've misunderstood anything, please feel free to
post here.

You can do this by registering a startup script to cause the form to submit
again.

For example, use following WebForm:

<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Please
wait..."></asp:Label>&nbsp;</div>
</form>

Handle its Load event:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ClientScript.RegisterStartupScript(GetType(), "postback",
"document.forms[0].submit();", true);
} else
{
// simulate a lengthy operation
System.Threading.Thread.Sleep(5000);
// hide the "please wait" prompt
Label1.Visible = false;
}
}

Also, you may find following article useful:

#PleaseWaitButton ASP.NET Server Control
http://www.codeproject.com/aspnet/PleaseWaitButton.asp

Hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
HttpSession gets generated again and again!! PLEASE HELP ME!!!! che Java 2 10-10-2005 10:20 PM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM
jserve booting again and again amit Java 0 10-02-2003 04:26 PM
post data, then post again.. JT ASP General 1 09-05-2003 11:14 PM



Advertisments