Got a fixed width website and can’t get it to centrally align in the window in Internet Explorer? Or you can get it to centrally align in IE but not in any other browser? Fear not, it’s not your fault! Unfortunately, the correct way of centrally aligning content through CSS doesn’t actually work in IE:

#cim_page-wrapper {
width: 66em;
margin: 0 auto
}

The second command, margin: 0 auto, basically gives our containing element an automatic margin on the left and right, thereby positioning the containing element in the centre of the browser window.

IE however, will need slightly different commands to make this work:

body {
text-align: center
}
#cim_page-wrapper {
width: 66em;
margin: 0 auto;
text-align: left
}

This will then centrally align the container in IE too. To prevent the text from centrally aligning too, we insert text-align: left into the container div.

Posted by: Diganta Kumar | November 21, 2009

Disabling Validation for ASP.NET Server Controls

When using validation controls in your ASP.NET pages you might want to disable validation in certain situations. The most common example is when you want to disable validation for a Cancel button. You can instruct the ASP.NET server control to disable just the client-side validation, or both the client-side and the server-side validation.

Disabling Client-Side Validation

If you want to perform only server-side validation and to avoid validation on the client, you can specify for certain ASP.NET Server controls not to not run client-side script validation. To disable client-side validation, set the validation control’s EnableClientScript property to false.

<asp:Button id=”CancelButton” runat=”server” Text=”Cancel” EnableClientScript=”False” />

Disabling both Client-Side and Server-Side Validation

You can specify that individual controls on a Web Forms page cause a postback without triggering a validation check.

If you want to bypass validation for a specific ASP.NET Server control, you’ll have to set the control’s CausesValidation property to false. Consider the ASP.NET code example below, showing how to disable validation for a Cancel button:

<asp:Button id=”CancelButton” runat=”server” Text=”Cancel” CausesValidation=”False” />

There is another way to disable a validation control, and you can accomplish it by setting the Enabled ASP.NET validation control property to false. Note that if you set Enabled to false, the ASP.NET validation control will not be rendered to the ASP.NET page at all:

<asp:RequiredFieldValidator id=”RequiredFieldValidator1″ runat=”server” ControlToValidate=”YourControlToValidate” ErrorMessage=”Your error message here” Enabled=”False” />

Posted by: Diganta Kumar | October 12, 2009

File Upload/Download File Size Limits

SharePoint store all the uploaded documents in the database. Having a restriction on the file upload size is always a good idea. You can do this two ways,

1. Give a upload file size limit under general setting of the web application in the central administration.

SPUploadSize

Upload size setting

2. Modify the metabase.xml file on the IIS server.

a. Before you can edit the metabase.xml file you must tell IIS to allow you to edit the file. In IIS, right click the name of the server and select properties. Check “Enable Direct Metabase Edit”.

IIS File Upload

IIS File Upload

b. Find the metabase.xml file located in C:\windows\sytem32\inetserv and open the file in Notepad.

c. Search for AspMaxRequestEntityAllowed and increase the value. The default value is 204800 (200K). Setting the value to 1000000 will allow 1 MB file uploads.

d. You may now wish to uncheck the IIS property called “Enable Direct Metabase Edit”.

To increase the file download size limit, repeat all steps above but in Step 3 find the parameter called AspBufferingLimit. The default download limit is 4MB.

Reference

http://stackoverflow.com

www.banmanpro.com

Older Posts »

Categories