Posts

Showing posts from August, 2012

ASP Ajax.Net

Autocomplete extender with Text/Value fields http://yasserzaid.wordpress.com/2010/05/14/get-text-and-value-pair-with-ajax-autocomplete-extender/ Easily refresh an UpdatePanel, using JavaScript http://encosia.com/easily-refresh-an-updatepanel-using-javascript/ makesure your id of the updatepanel is accessible by javascript

Shots of here & there, from my Nikon D3100

Image

Asp Page Lifecycle Full

Understanding the Page Life Cycle can be very important as you begin to build Pages with MasterPages and UserControls. Does the Init event fire first for the Page, the MasterPage or the UserControl?  What about the Load event? If you make an incorrect assumption about the sequence that these events fire, then you may end up with a page that simply doesn't behave the way you had anticipated. By running a simple test, we can see exactly when each event fires.  Our test setup is composed of a Page, MasterPage, UserControl, Nested UserControl and Button control as follows: The Page is tied to the MasterPage The UserControl is on the Page The Nested UserControl is on the UserControl The Button is on the Nested UserControl. Clicking the Button calls the Page.DataBind method Each event on these controls has been set to call Debug.WriteLine as each event is raised.  In addition to the events that get raised for regular pages, I've a...

Photo Shooting Techniques

Image
Shooting for Better Photos? Details Can Make the Difference.     Photographing the Night Sky   Photographing the Night Sky: Star Trails Bokeh for Beginners Photographing Sports Indoors and Out http://www.nikonusa.com/Learn-And-Explore/Photography-Techniques/Shooting-Techniques.page

Null check and Convert DB helper Extension

public static class ReaderHelper {     public static bool IsNullableType ( Type valueType )     {         return ( valueType . IsGenericType &&             valueType . GetGenericTypeDefinition (). Equals ( typeof ( Nullable <>)));     }     public static T GetValue < T >( this IDataReader reader , string columnName )     {         object value = reader [ columnName ];         Type valueType = typeof ( T );         if ( value != DBNull . Value )         {             if (! IsNullableType ( valueType ))             {                 return ( T ) Convert . ChangeType ( value , valueType );             }       ...

SQL Server Insert rows by XML

Should be carefull  when defining the source With - Exact names of xml inputs INSERT INTO @TblEmpSalaries         SELECT emp_no,currency,                 Encryptbypassphrase(@EncrpKey,CONVERT(VARCHAR(20), base)),                 Encryptbypassphrase(@EncrpKey, CONVERT(VARCHAR(20), current_ctc)),                 country,onsiteoffshore         FROM   OPENXML(@EmpSalariesHandler, '/dsUpdatedSalDtls/dtUpdatedSalDtls', 2)         WITH (Emp_No INT, Currency VARCHAR(50), Base FLOAT, Current_CTC FLOAT, Country VARCHAR(150),             OnsiteOffshore    VARCHAR(50))