Posts

Showing posts from September, 2011

Best practice for working with DateTime in asp.net and my sql server

Best practice for working with DateTime in asp.net and my sql server
Or
Format the update parameter value at time of updating List View

my sql store data in  yyyy-mm-dd format...
but it can execute update command if date is in mm/dd/yyyy fromat.
My web app displays controls in uk , indian format ie dd/mm/yyyy
You can retrive date in dd/mm/yyyy format from mysql by folowing query 
SELECT  DATE_FORMAT(sch_dt,'%d/%m/%Y') as sch_dt,  FROM comm_prog


So finally here is the Best practice for working with DateTime in asp.net and my sql server.

Make an entry in your web.config file like this inside system.web

 <!-- To let the default date as en-US style mm/dd/yyyy in backgrount and let controls have en-GB dd/mm/yyyy format /  Culture fr-CH, Date: 30.11.2007 00:00:00-->
 <globalization   requestEncoding="utf-8"   responseEncoding="utf-8"   culture = "en-US"   uiCulture = "en-US" />


Let the user see dates in dd/mm/yyyy format
like:



       <…

ASP.NET pure css menu with IE7 hover problem fix

ASP.NET pure css menu with IE7 hover problem fix:What happens in IE7 is, that the submenu appears just as long as the mouse hovers over the parent menu item. So once you move the cursor downwards over the submenu, the submenu simply disappears.The drop down menu works in Firefox, but randomly disappears in IE. drop down menus using Javascript to begin with, however, I always recommend using CSS over javascript, unless you need some animation effects (because CSS renders faster then JS and it does not require the browser to have javascript turned on).
The classic CSS :hover syntax for drop down menus looks like this: 1

ASP.NET Menu Control with XML Data source

ASP.NET Menu Control with XML Data source
With the help of this link of all pages of website can be configured through single xml file.


Known issue: it was not working properly with ie7 on hover event. Also in chrome gives wierd menu type with one level up , expand. Recommended to go for pure css menu. http://vinodkotiya.blogspot.com/2011/09/aspnet-pure-css-menu-with-ie7-hover.html
you may prefer to build drop down menus using Javascript to begin with, however, I always recommend using CSS over javascript, unless you need some animation effects (because CSS renders faster then JS and it does not require the browser to have javascript turned on).
1. Put the menu control as follow




<div id="menu1">
<asp:Menu ID="Menu1" runat="server" MaximumDynamicDisplayLevels="4" StaticDisplayLevels="2"
            DynamicHorizontalOffset="2" DynamicVerticalOffset="2" StaticEnableDefaultPopOutImage="false"
            Orie…

Google+ Followers