Disable Dates in a Calendar

From my previous experiences , what i have found out is that sometimes we need to disable the previous and coming dates in a calendar control. So finally i thought to post it out. It goes like this....,



protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date< DateTime.Today)
{
e.Day.IsSelectable = false;
e.Cell.ToolTip = "This date is not available";
}
else if (e.Day.Date> DateTime.Today)
{
e.Day.IsSelectable = false;
e.Cell.ToolTip = "This date is not available";
}
}

Keep rockiin........


Tags: , , , ,
Categories: ASP.NET

7 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Detecting User's IP Address

If your website contains sensitive data and you don't want any spamming or any malicious use of your website ,then one thing you can do is to keep a track of the visiting user's system IP and this can be done in some easy steps given below,


string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();


Now set the value of clientIPAddress to either a Textbox or label or any control as per your requirement.


Tags: , , , , , ,
Categories: ASP.NET

23 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Using the Google search from ASP.NET

I hope that every one has thought of using the infamous Google Search in their projects/applications but couldn't figure out as to how to do this..

Fine... now you can integrate Google Search into your applications..

Check out the below article and figure out the truth..

http://www.communitymx.com/content/article.cfm?page=1&cid=E8E8CE970C6AB073


Happy Programming. :)


Tags: , , , , ,
Categories: ASP.NET

3 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Why do ASP.NET AJAX page methods have to be static?

This has been a question of concern for quite sometime now.. So to solve the issue , i suggest you to have a look at the below article .

Hope you like it . :)

http://encosia.com/2008/04/16/why-do-aspnet-ajax-page-methods-have-to-be-static/


Tags: , , , , ,
Categories: AJAX

3 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

 


© Copyright 2009. www.onlineasp.net All Rights Reserved.