Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Splash screen on page

Posted on 2005-05-10
6
Medium Priority
?
377 Views
Last Modified: 2008-03-10
My web app will be sending multiple emails. this could be processor intensive and i want to display a splash screen while this is generating and sending the personnalised emails.

How do i add a splash screen while this is happening?

I tried a simple Response.Flush() before the bulk of the code, but *shrugs*

Also can i implement this to a user control and not a page? As my app is all user controls

Cheers

apb2
0
Comment
Question by:apb2
  • 2
  • 2
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 13969328
Do the processor intensive part in a separate thread, and redirect to a page that refreshes itself every so often and checks whether that thread is done.
0
 
LVL 33

Expert Comment

by:raterus
ID: 13969359
Response.Flush really doesn't work anymore like it did in ASP since ASP.net does all the processing work before it generates any html.  There are plenty of solutions available on the internet/EE that demonstrate "Please Wait" examples, here is one:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20851887.html
0
 
LVL 6

Author Comment

by:apb2
ID: 13969421
Hi raterus

That solution is for a windows form. Have you got a solution for a web form

Thanks again
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 33

Expert Comment

by:raterus
ID: 13969462
whoops!  sorry about that..Here is something that is interesting,
http://www.codeproject.com/aspnet/PleaseWaitButton.asp
0
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 1600 total points
ID: 13970927
Very simple example of my approach:

Thread Class (does the lengthy processing)
----------------------
mports System.Threading

Public Class ThreadClass

    Public Shared Sub Proc()

        For i As Integer = 0 To 50
            Dim sw As New IO.StreamWriter("c:\inetpub\wwwroot\xp\data\log.txt", True)
            sw.WriteLine("line " & i.ToString)
            sw.Close()
            Thread.Sleep(3000)
        Next
    End Sub

End Class
--------------------------------


Button handler (in your main page)
--------------------------------
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim t As New Thread(AddressOf ThreadClass.Proc)
        Session("t") = t
        t.Start()
        Response.Redirect("splash.aspx")
    End Sub
--------------------------------

Splash page just has a label and any bling you want to add (updates every 5seconds (5000ms)):
  of course, instead of changing title to "done:" you can redirect to final page
--------------------------------
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim t As Thread = Session("t")
        If t.IsAlive Then
            Label1.Text = "still running:"
        Else
            Label1.Text = "done:"
        End If
        Dim sr As New IO.StreamReader("c:\inetpub\wwwroot\xp\data\log.txt")
        Label1.Text &= sr.ReadToEnd()
        sr.Close()
        RegisterClientScriptBlock("x", "<script type='text/javascript'>var s = 'window.document.forms[0].submit()'; window.setTimeout(s, 5000);</script>")
    End Sub
--------------------------------
0
 
LVL 6

Author Comment

by:apb2
ID: 13979280
Sweet!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question