in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Rajiv and Michael's SharePoint discoveries and musings...

TIP: Using code blocks in master pages throws error

If you want to use script tags for dynamic content in a master page, for example:

 <%= DateTime.Now %>

and you recieve the following error:

Include the following in your web.config file to resolve this issue:

 

 

Comments

 

Kevin Cornwell said:

Can't read the web.config image (nor copy paste).

June 28, 2007 9:45 AM
 

mossman said:

I have heard from some sources that this practice is frowned upon for security reasons. I'm guessing this COULD allow users with certain privileges to run code in their master pages they have added with sharepoint designer. Though, I could perhaps argue that if you can't trust them with spd access... maybe you should be able to trust them with this.

June 28, 2007 11:10 AM
 

mossman said:

I meant to say "if you CAN trust them with spd access"...

June 28, 2007 11:11 AM
 

Links (6/28/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (6/28/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

June 28, 2007 8:42 PM
 

RChakravarti said:

Kevin,

Sorry about you not being able to read the images. I have attempted to resolve that in this post, please click on the image and it should open up in a new window in a more readable form.

Regards,

Rajiv

July 19, 2007 8:04 AM
 

relishguy said:

Of course, you can also update the master page in the filesystem..then code will be executed correctly.

Regards..

February 28, 2008 5:44 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts