Mail Counter in asp.net 3.5

  • Thread starter Thread starter sajit
  • Start date Start date
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.
 
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
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.
 
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)
 
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my bloghttp://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:http://gregorybeamer.spaces.live.com/

*************************************************
| 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.
 
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.
 
Back
Top