Mail Counter in asp.net 3.5

S

sajit

Hi Folks,

Right now I am working on eMail Marketing System. There I have a
module which sends news letters to subscribers. The problem is I want
to put a counter on a page to display sent mails like 12/123. I tried
to display the counter value is label but in vain. It seems like label
is not rendered until the click event finishes it code.
Any help is appreciated.

Regards,
Sajit Nayar.
 
C

Cowboy \(Gregory A. Beamer\)

Are you trying to keep the counter going as the messages are sent?

If so, you will need to use something like AJAX to do this or some type of
control (ActiveX, Java) that can get the updates. Regardless of what you
use, it will never be accurate to the second, as there will be network
latency.
 
M

Microsoft Newsserver

yeah, well that wasnt really crystal clear. He could have been sending
individual messages with every click, but looking at it again I guess you
are probably correct is assuming he has started a process and wants to see
the progress of it.
 
B

bruce barker

if the emails are only in the 100's, then you can use server push for this.
turn off buffering, use simple html and flush to send the response to the
browser.

you can do a list:

while (moreEmaii)
{
sendemail();
Response.Write("sending email " + email.id);
Response.Flush();
}

or if you want a counter, then a little javascript:

<script>
function update(s)
{
document.getElementById('response').innerHTML = s;
}
</script>
<div id="'response'></div>

then serverside:

Response.Write(string.Format("update('{0}');",messge);


-- bruce (sqlwork.com)
 
S

sajit

Are you trying to keep the counter going as the messages are sent?

If so, you will need to use something like AJAX to do this or some type of
control (ActiveX, Java) that can get the updates. Regardless of what you
use, it will never be accurate to the second, as there will be network
latency.


| Think outside the box!
|







- Show quoted text -

Hi Gregory,

I want to increase the counter only when the mail is successfully
sent. There is a requirement to display the current statue of total
mail being sent. I hope this will make it clear to you what I want to
achive here.

Regards,
Sajit Nayar.
 
U

upendar reddy

sending an email through label.it is working but label content could not send because it is like label in our mail.plz help me in this.label content is changed automatically.
Why not update the label at the end of the click event ?
On Monday, April 28, 2008 9:35 AM Mark Rae [MVP] wrote:


Yes, that's correct, and that is the default behaviour of web applications.

You'll need to use something like AJAX for this. Do a Google for AJAX
progress bar, and you'll find loads of examples of how AJAX can update a
section of the page according to iterative server-side activity. Then it
will be a relatively simple matter to convert one of the code examples to
update your label control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top