469,580 Members | 1,876 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,580 developers. It's quick & easy.

Mail Counter in asp.net 3.5

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.
Jun 27 '08 #1
7 1080
Why not update the label at the end of the click event ?
"sajit" <na*********@gmail.comwrote in message
news:01**********************************@i36g2000 prf.googlegroups.com...
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.

Jun 27 '08 #2
"sajit" <na*********@gmail.comwrote in message
news:01**********************************@i36g2000 prf.googlegroups.com...
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.
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.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3
"Microsoft Newsserver" <me@nowhere.comwrote in message
news:%2*****************@TK2MSFTNGP02.phx.gbl...
>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.

Why not update the label at the end of the click event ?
Because the OP wants the label to be updated every time an email has been
sent...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #4
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!
|
*************************************************
"sajit" <na*********@gmail.comwrote in message
news:01**********************************@i36g2000 prf.googlegroups.com...
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.

Jun 27 '08 #5
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.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OS**************@TK2MSFTNGP05.phx.gbl...
"Microsoft Newsserver" <me@nowhere.comwrote in message
news:%2*****************@TK2MSFTNGP02.phx.gbl...
>>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.

Why not update the label at the end of the click event ?

Because the OP wants the label to be updated every time an email has been
sent...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #6
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}');",mess ge);
-- bruce (sqlwork.com)
"Cowboy (Gregory A. Beamer)" wrote:
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!
|
*************************************************
"sajit" <na*********@gmail.comwrote in message
news:01**********************************@i36g2000 prf.googlegroups.com...
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.


Jun 27 '08 #7
On Apr 28, 6:38*pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamMwrote:
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!
|
*************************************************" sajit" <nayar.sa...@gmail.comwrote in message

news:01**********************************@i36g2000 prf.googlegroups.com...
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.- Hide quoted text -

- 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.
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by pee2pee | last post: by
4 posts views Thread by Shane | last post: by
2 posts views Thread by Didier FRAISSE | last post: by
2 posts views Thread by hungryblank | last post: by
3 posts views Thread by chuckdfoster | last post: by
1 post views Thread by robbiesmith79 | last post: by
11 posts views Thread by Taras_96 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.