Geeks With Blogs
Moez Mousavi December 2010 Entries
Repeater with no data
Empty data in repeater doesn't have a template. Have a look at this: if (rptMyRepeater.Items.Count < 1) { if (e.Item.ItemType == ListItemType.Footer) { Label lblFooter = (Label)e.Item.FindControl("... lblFooter.Visible = true; } } I found the above code is usefull if you need to show something like "There is no record" is your data source has no records. Although the ListView has a template ......

Posted On Thursday, December 30, 2010 1:25 AM

Client side page validation
Wish you ever validate the page using .NET validation controls in JS for any reason? Just use Page_ClientValidate in a javascript function or something. Page_ClientValidate('Valida... ......

Posted On Thursday, December 30, 2010 12:37 AM

The life saver HttpContext.Current.Items["ParameterName"]
I got stocked passing parameter to one master page for some reasons, seems the page lifecycle and dynamic loading of the master pages has got some issues with defining public properties in the masterpage within my project. It did not set my values and as a result, properties became useless. A collegue just mentioned using HttpContext. have a look what MSDN saying "Encapsulates all HTTP-specific information about an individual HTTP request" ......

Posted On Thursday, December 30, 2010 12:33 AM

The Current week dates
The Current week dates Might be a bit weird as we normaly not writing a multicultural web site. So not very frequently using CultureInfo however, it is actully quite good to use it to get the week days. Seems the class has got some issues in .NET 2.0 as it was not picking the first day of the week correctly, I have used the below code in 3.5 and it does work. CultureInfo info = Thread.CurrentThread.Curren... DayOfWeek firstday = info.DateTimeFormat.FirstDa... DayOfWeek today = info.Calendar.GetDayOfWeek(... ......

Posted On Thursday, December 16, 2010 11:37 PM

Copyright © MoezMousavi | Powered by: