Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mail Counter in asp.net 3.5

2 views
Skip to first unread message

sajit

unread,
Apr 28, 2008, 9:08:57 AM4/28/08
to
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.

Microsoft Newsserver

unread,
Apr 28, 2008, 9:13:05 AM4/28/08
to
Why not update the label at the end of the click event ?


"sajit" <nayar...@gmail.com> wrote in message
news:01c8fa60-6cc8-4127...@i36g2000prf.googlegroups.com...

Mark Rae [MVP]

unread,
Apr 28, 2008, 9:36:26 AM4/28/08
to
"Microsoft Newsserver" <m...@nowhere.com> wrote in message
news:%23Gfe%23ITqI...@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

Mark Rae [MVP]

unread,
Apr 28, 2008, 9:35:43 AM4/28/08
to
"sajit" <nayar...@gmail.com> wrote in message
news:01c8fa60-6cc8-4127...@i36g2000prf.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.

Cowboy (Gregory A. Beamer)

unread,
Apr 28, 2008, 9:38:40 AM4/28/08
to
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" <nayar...@gmail.com> wrote in message
news:01c8fa60-6cc8-4127...@i36g2000prf.googlegroups.com...

Microsoft Newsserver

unread,
Apr 28, 2008, 10:43:38 AM4/28/08
to
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.net> wrote in message
news:OSnrXTTq...@TK2MSFTNGP05.phx.gbl...

bruce barker

unread,
Apr 28, 2008, 12:11:01 PM4/28/08
to
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)

sajit

unread,
Apr 29, 2008, 5:38:16 AM4/29/08
to
On Apr 28, 6:38 pm, "Cowboy \(Gregory A. Beamer\)"

<NoSpamMgbwo...@comcast.netNoSpamM> 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 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.com> wrote in message

>
> news:01c8fa60-6cc8-4127...@i36g2000prf.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.

upendar reddy

unread,
Feb 18, 2011, 2:16:18 AM2/18/11
to
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.

> On Monday, April 28, 2008 9:13 AM Microsoft Newsserver wrote:

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


>> On Monday, April 28, 2008 9:35 AM Mark Rae [MVP] wrote:

>> "sajit" <nayar...@gmail.com> wrote in message
>> news:01c8fa60-6cc8-4127...@i36g2000prf.googlegroups.com...
>>
>>

>> 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


>>> On Monday, April 28, 2008 9:36 AM Mark Rae [MVP] wrote:

>>> 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


>>>> On Monday, April 28, 2008 9:38 AM 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/
>>>>
>>>> *************************************************

>>>> *************************************************
>>>> "sajit" <nayar...@gmail.com> wrote in message
>>>> news:01c8fa60-6cc8-4127...@i36g2000prf.googlegroups.com...


>>>>> On Monday, April 28, 2008 10:43 AM Microsoft Newsserver wrote:

>>>>> 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.net> wrote in message
>>>>> news:OSnrXTTq...@TK2MSFTNGP05.phx.gbl...


>>>>>> On Monday, April 28, 2008 12:11 PM brucebarke wrote:

>>>>>> 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)
>>>>>>
>>>>>>
>>>>>> "Cowboy (Gregory A. Beamer)" wrote:


>>>>>>> On Tuesday, April 29, 2008 5:25 AM sajit wrote:

>>>>>>> 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.


>>>>>>>> On Thursday, May 01, 2008 11:07 PM sajit wrote:

>>>>>>>> On Apr 28, 6:38=A0pm, "Cowboy \(Gregory A. Beamer\)"
>>>>>>>> <NoSpamMgbwo...@comcast.netNoSpamM> wrote:
>>>>>>>>
>>>>>>>> l.com> wrote in message


>>>>>>>>
>>>>>>>>
>>>>>>>> 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.


>>>>>>>> Submitted via EggHeadCafe
>>>>>>>> Creating Google Motion Charts from Excel data
>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/86599bca-edda-4204-af15-7a1cf901a071/creating-google-motion-charts-from-excel-data.aspx

0 new messages