Saturday, September 21, 2013

How to change the .htaccess file name?


To use a different name from the the default .htaccess use the AccessFileName directive in httpd.conf file.
AccessFileName yourFileName
All you need to do is to reload Apache and the new setting will take effect.

TopHost Hostgator GoDaddy .htaccess Settings

The top web comes with mod_rewrite enabled. To use it, create a. htaccess file with the appropriate directives. 

Remember to always insert the Directive: 
RewriteBase / 

where / and 'the path of the. htaccess file, so if the. htaccess file is located in the subfolder demo must' be: 
RewriteBase /demo

Wednesday, September 11, 2013

How to hide asp net DataPager when there is only one page

When you use DataPager with ListView and there is only one page of data you still see the pager. So if you don't like the pager like me you can use below piece of code to hide it.

//Data Pager Outside ListView
        protected void lView_DataBound(object sender, EventArgs e)
        {
            dPager1.Visible = (dPager1.PageSize < dPager1.TotalRowCount);
        }
 
        //Data Pager Inside ListView
        protected void lView_DataBound(object sender, EventArgs e)
        {
            DataPager dPager = (DataPager)lView.FindControl("dPager1");
            dPager.Visible = (dPager.PageSize < dPager.TotalRowCount);
        }

Tuesday, September 10, 2013

How to display original quality image in Crystal Reports

Step 1:
Open any crystal report
Step 2:
Go to Menu->Crystal Report->Design->Default Settings
Step 3:
Go to Reporting Tab and make sure "Retain Original Image Color Depth" is checked

Note: Try using images with no transpareny for good quality.

Sunday, September 8, 2013

What is the difference between Public, Private, Protected And Internal

Anywhere Same  class Derived Classes Same Assembly Derived Classes in
another assembly
Public




Private




Protected



Internal




Protected
internal