Multichoice CheckBoxList Control in C#

by daz 9/28/2009 7:55:00 AM

I love designer ! You are wondering why?

They always challenge you. Thus i was involve in a project where a designer of my team propose to have  a multichoice checkboxlist control in a page. Dummy!

It look fancy but pretty nice. Imagine a dropdownlist of Countries grouped by Languages in 3 column.

My next Post is about to create this control that will added a cool look in your website.

Comeback2C next week

Schedules a Timer in a Website : C#,asp.net Automation Method

by daz 9/22/2009 3:58:00 AM

I had a project that consist of opening an Emailbox, read all the Spam and get the emails(from email of course), other parameters... and insert them in a Sql Database Table. I have a Button on a page where the admin of the site will go and click to start the reading. Problem: when it got to 350 emails, u got a Page Time out. Solution: Create a Timer for every 30 min , read the mail box. Now get rid of the Admin pain!! I will demonstrate how this can be done

To first start make sure you have the Global.asax file in your Project. I am using asp.net 3.5 and Linq to Sql for this particular Website I create a file SpamReader.cs inside of my Utils Project.

public class SpamReader {
public SpamReader()
{
}
public void _timer_Elapsed(object sender, ElapsedEventArgs e) {
ReadSpamComplaint();
}
public void ReadSpamComplaint()
{
string sServer = "pop.mysite.com";
string sUserName = "username";
string sPassword = "password";
GetMyMails(sServer, sUserName, sPassword, false);
}
private static void GetMyMails(string sServer, string sUserName, string sPassword, bool bSSLConnection)
{
}
}

It is about it. Hold on, one more thing to do. Now it is time to use the Timer class. Very easy...Open your Global.asax.cs and in Application start call the Spamreader class..


protected void Application_Start(object sender, EventArgs e)
{
SpamReader spam = new SpamReader();
Timer zTimer = new Timer();
zTimer.Elapsed += new ElapsedEventHandler(spam._timer_Elapsed);
zTimer.Interval = 900000;//every 15 min
zTimer.Start();
}

and set the timer to what ever you want. my case 15min=15x60minx60sec and add 000 for the Miliseconds.. That 's about it. I hope you enjoyed it. Leave a comment please.

About the author

Name of author
DavidZ
.Net Programmer
E-mail me Send mail

Calendar

<<  August 2010  >>
MoTuWeThFrSaSu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in