Posts

Showing posts from June, 2011

best practice for CSS : Display same font size in all browser.

There is a cross browser problem with css regarding font size. each browser display font size differently. To overcome this issue. You should declare standard font size say 14px in your body code in css like this:


body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: black;
}

Now you take 14 px; as relative to define font size for other tags in your css like:
If you want to have 18px font then declare like this

.post .title a {
font-size: 1.125em; /* 18px/16=1.125em   Here em is 1.125 times the 14px of body font size*/
color: #618C04;
}


Now your page will almost look similar in all browsers. and zoom in and zoom out will work effectively.
If you use  font-size: 100%; in body tag then it may still arise problem because each browser has different default font size.


- Vinod K



Asp.net button not firing on modal pop up extender

I have a TabPanelcontroller having the grid view. On grid row selection a modal popup extender shows the detail of that row... It has a submit button btn_Approve_Approved which should perform some database operation and refresh the grid.

The button btn_Approve_Approved was not firing untill i was using the OkControlId of Modal Popup extender. To get the modal pop up buttons work you should remove the OkcontrolID and CancelControlID. And write your own code for your buttons...


  <!-- Start of Modal Popup for Leave approval just below the concerned grid view -->
              <asp:Button runat="server" ID="btnShowModalPopup" style="display:none"/>    
          <asp:ModalPopupExtender ID="ModalPopupExtender_Approve" runat="server" TargetControlID="btnShowModalPopup" PopupControlID="up_Modal_Approve" BackgroundCssClass="modalBackground" dropshadow="true"  PopupDragHandleControlID="p…

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

My web app displays controls in uk , indian format ie dd/mm/yyyy
but I got lots of error when inserting this format to database like String was not recognized as a valid DateTime.
or unable to convert varchar type to datetime.
So finally here is the Best practice for working with DateTime in asp.net and sql server.

Make an entry in your web.config file like this

(!-- 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:TextBox ID="txtHolidate" runat="server" CssClass= "tbox" Font-Names="Arial" 
                  ForeColor="#0066FF" Wrap="False" Height="16px" Width="94px" 
                   Valid…

Google+ Followers