Wednesday, March 16, 2011

Customizing the Access Denied Message (AccessDenied.aspx)

Request from client to customize the default access denied error message!!
By Default:

After Customizing the accessdenied.aspx page:
Note: If you want to be more fancy, you can replace the simple.master page with your own master page!














Parts been customizable as show:















Achieved by modifying 2 files


1. SharePoint resource file wss.en-US.resx (from Virtual Directory \App_GlobalResources\wss.en-US.resx)







2. AccessDenied.aspx (from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS)


Note: Please keep the Original file as a backup
















CSS:
<style type="text/css" >

BODY #s4-simple-card H1 {margin-bottom:10px; color:#5b4b3e ; font-size:2em; font-weight:normal;padding-top:3px}

.ms-sectionheader {font-family: Verdana, Arial, sans-serif; color:#595959; font-size:2em }

.ms-descriptiontext {text-align:left; font-family:Verdana, Arial, sans-serif; color:#3f3f3f;font-size:10pt}
A:link, .ms-descriptiontext A:visited, .ms-descriptiontext A:hover { color:#0072BC; font-weight:bold; text-decoration:none; }
.s4-simple-iconcont { z-index:2; background-image: url('/_layouts/images/setcredentials_32x32.png'); HEIGHT: 60px; TOP: 10px;
background-position:left center; background-repeat: no-repeat; }
.s4-simple-iconcont img {display:none;}

</style >

Monday, March 7, 2011

How to Control Hyper Link Attributes to Open In a New Window

Wondering how to control the Hyper Link control behavior! Like STYLE, OPEN , SET FOCUS & ATTRIBUTES

Current project requirement to open the Hyper link with specific browser attributes like With Scroll bar, No Menu bar, Specific Window Position, Height & Width.

Achieved with Java Script as shown below code:

string strURL = "http://rajadandu.blogspot.com/";

//Create Hyper Link
HyperLink h = (HyperLink)e.Row.FindControl("ConfHlink");

// Setting Style
h.Style["margin-left"] = "5px";

//Setting default Hyper Link Navigation to NULL
h.NavigateUrl = "javascript:void(null);";

//Hyper Link Display string
h.Text = "Opening With Controlled Hyper Link";

//Java Script with Open Window with attributes
//Then at last Set Focus
h.Attributes["onclick"] = "javascript:window.open('" + strURL + "','','scrollbars=yes,menubar=no,height=430,width=700,top=0,left=0,resizable=yes,toolbar=no,location=no,status=no'); window.focus();";

Thursday, March 3, 2011

Open PDF makes you save!!

After few Hrs of research find out that this particular setting will now open’s .PDF directly in IE; by default is “Strict” which prompts the user for file download.

Step-By-Step:
You can fix this by navigating in to central admin


Application Management >> Manage web application

Now choose your web application (select the row) which makes ribbon to be active

and you will see general settings (in enabled mode) Now choose general settings from the drop down

find he Browser File Handling section by default it's strict, change it to Permissive click ok and you are done!!