.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Get Page Layout to check whether a field is filled in and display

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :SharePoint
I have a page layout that has a URL Field which users can fill in, if needed.  The field is:
<SharePointWebControls:UrlField FieldName="DetailedInformation" InputFieldLabel="Link to Plan Change page" runat="server"/>

This field lives in the Edit Mode Panel but I need to display it within the page, if the user fills it in.

The only way I know how to display fields throughout a text of the page, is to use the FieldValue, e.g.

<SharePointWebControls:FieldValue FieldName="DetailedInformation" runat="server"></SharePointWebControls:FieldValue>

Is there a way to say "if the above field is not null, then display with formatting as below" - similar to an If statement.

<p class="ms-rteCustom-hyperlink-arrow">
	<SharePointWebControls:FieldValue FieldName="DetailedInformation" runat="server"></SharePointWebControls:FieldValue>

If I put the above code and the field isn't filled in, the arrow (from the class) will display but I do not want it to.

Please note that I am using SharePoint Designer 2007 to create the page layout.

View Complete Post

More Related Resource Links

Set custom publishing page layout custom field programatically


I have a custom publishing page content type, based on the Publishing Article Page content type. On this content type, I have a custom field named "PageContentCategory". In my code to create new pages, I tried this:


PublishingPage newPublishingPage = this.currentPublishingWeb.GetPublishingPages().Add(pageName, newPageSelectedLayout);

if (pageContent.IsEmpty())
 pageContent = Properties.Resources.EAWorldArticleHandler_CreateNewArticlePage_DefaultPageContent;

newPublishingPage.ListItem[new Guid("{93496B35-7EC3-4132-B0D0-3BDC5606F5EF}")] = pageContentCategory;
newPublishingPage.ListItem[FieldId.PublishingPageContent] = pageContent;
newPublishingPage.Title = pageTitle;


I have also tried to set it by the field name:


PublishingPage newPublishingPage = this.currentPublishingWeb.GetPublishingPages().Add(pageName, newPageSelectedLayout);

Page layout - Custom Multi line field limits at 255 chars



Hi group,


I hope i use the correct terms since I have a DUTCH :-( Sharepoint version.


I created a new Site Content Type, called activity.

I added a new column (Add from new site column)

The type of this column is: Multiple lines of text.

(I choose this because single line of text can contain up to 255 chars)


In Microsoft Office Sharepoint Designer (MOSD) I created a new pagelayout (File => new => Sharepoint Content => pagelayout)

and inserted the field activity to the .aspx page.

<SharePointWebControls:NoteField FieldName="Comments" runat="server"></SharePointWebControls:NoteField>

Why is the fieldname Comments I expected Activity?


I then created a new page (in MOSS) based on the created pagelayout.


Works like a charm.

Problem: I cannot add more than 255 chars to the field activity although it is a multiline type.

Does anybody

Hide / display page layout columns for different users


I'm looking for a way to hide some columns of a page layout so they will be shown only to specific audience (for example hide the "created by" column so some users won't see it). Any suggestions?


CreatePage.aspx cannot display page layout preview image


I am using a custom site template and functions fine, except that when I get to the CreatePage.aspx page, the preview image is not displayed. When I looked up the properties on that image, it was looking for the image in a location other than the place where it should.

For eg: Instead of looking for it at /_catalogs/masterpage/en-US/Preview%20Images/ArticleBodyOnly.png  it looks for it at xxx/test/_catalogs/masterpage/en-US/Preview%20Images/ArticleBodyOnly.png where xxx was an external consultant that worked on this site before me and I am new to sharepoint. The only scenario when this doesnt happen is for the DefaultPageLayout.png file.

This problem seems to repeat everytime I use this site template. When I open up the sites with these templates on Sharepoint Designer, I can see all the preview images over there. For some reason, the CreatePage.aspx is not looking for the images in this location and looks for it at another location.

I am really stuck with this issue, can someone please help me understand why this is happening or help me resolve this?


Want to create Page URL rewrite based on Users GUID and Display name?



I am using the asp.net membership. 

On my site I have a Profile.aspx page.

In the code behind of this page,  i get the logged in UserId (Guid) and pass

this to a method in my DAL. GetUserByUserId()


In my database I have a Table called Member which the method gets the data from

and displays details on the page about  the user.


What I want to happen is when they have logged in and are diverted to Profile.aspx,

the page URL shows www.MyWebSite/Profile/UsersName 

for example



is this possible. In my Member table I have FirstName and LastName columns or do I get the

name from the membership table.


even better would be they go straight to www.MyWebsite/JohnSmith.aspx


thank you for any help






Panels messing up page layout



On a few different pages in my web app I have a scrollable panel that contains a gridview. When there is nothing in the panel display as I want it to, however when the grid view is populated with data it stretches the panel across the page which looks awful, it means the panel is partially stretched across the window but is still scrollable

Anyone know why this might be happening?



Page layout list not displaying in page settings



I have 4 different custom page layouts in my publishing site at the site collection level. I have one site named "Services" in site collection. When i create page, i select one page layout from above 4. But when i go to the page settings of that page to change the page layout of it, i can see only one page layout which this page based on.

Problem is why all the page layouts not listing there? I checked "Page layout and site templates" settings from look and feel of Site Settings, this r set to "Pages in this site can use any layout".

Please help..!

Thanks in advance.


Sandip Patil

Sharepoint Developer


Content deployment: pages not based on a page layout

Is it possible to use content deplyoment feature when pages (in page library) are not based on a Page Layout?

Variation label in a page layout and Translated Columns



Can any body elaborate on this two terms in publishing sites.

1: Variation label in a page layout

     When i edit the page layout from browser interface of publishing site with variation, there is one field called "Variation" where user

     have to select the variation label from a list.

2: Translated Columns

     Don't know what is this, i try to google a lot but not found any information.


Thanks in advance

Regards Sandip Patil Sharepoint Developer http://www.worldofsharepoint.com

SharePoint 2007 - Consolidating everything as feature into WSP [Content Type, Page Layout, Pages, Ma


Hello –


Overview – We are building a Mobile Web Site using SharePoint 2007. The big screen site has been already built and we need to integrate the mobile site into same site collection of big screen –


·         The Mobile site will use the existing content types of existing big screen site

·         We will build a new custom Master page

Do Post to Iframe in same page, and Password Field


Hi all,

I need do post of a form in my page to Iframe in the same page.

I set target in form tag.

<body onload="document.formuno.submit()">

                               <form name="formuno" method="post" action="http:\\externalCompany.WebForm.aspx" target="framename"  >

                                               <input type="hidden" name="prueba"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba2"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba3"  value="pruebatxt" runat="server">

<input type="hidden" name="password"  value="MY PASSWORD" runat="server">


Microsoft Report Viewer control to display data on one page


Hello everyone,

I am wondering if the Microsoft Report Viewer control allows for display changes.  Say for instance a user wants would like to see all the data requested then another time would like to toggle thru the pages of infomation.  So does anyone know if the control allows for display changes from complete view to paginated viewing.  I am using MS VS 2008 with ASP.NET 3.0.  Thanks for your response.


"Enable this Form to be filled out by using a browser" check box is grayed out when publishing InfoP

When I try to publish InfoPath form to a SharePoint site collection, "Enable this Form to be filled out by using a browser" check box is grayed. Also, I see the following warning message: This form template is br owser-compatible, but it cannot be browser-enabled on the selected site. This may be cased by one of the following reasons: -The server is not running InfoPath Forms Services. - The necessary features are not available on the site collection. The policy setting on the server does not allow user to browser -enabled Form templates. I have tried the following: 1. Deactivated and reactivated " office SharePoint Server Enterprise Site collection features" 2. Deactivated and reactivated " office SharePoint Server Enterprise Site features" 3. "Form Templates" document library exists and visible. 4. I am able to check the box in other site collections without any problems. 5. Ran the following stsadm commands: STSADM.EXE -o deactivatefeature -filename IPFSAdminLinks\feature.xml -url http://siteCollection -force STSADM.EXE -o deactivatefeature -filename IPFSSiteFeatures\feature.xml -url http://siteCollection -force STSADM.EXE -o deactivatefeature -filename IPFSWebFeatures\feature.xml -url http://siteCollection -force STSADM.EXE -o activatefeature -filename IPFSAdminLinks\feature.xml -url http://siteCollection -force STSADM.EX

How to Layout Web Page?

Hello everybody. I am new in web development and I am designing a web based application now a days. This is my semester project and as well as my first web application. So I have designed the home page using fixed layout taking my pc's 1600x900 resolutions under consideration. I have tested it in IE, Firefox, and Chrome. But I am getting a horizontal scrollbar. And I have come to know that use of fixed layout reduce the portability of web site. I need some information/web link and help on liquid layout. I am collecting images from various free template provider website for my web pages and also taking concepts from that. Any help, any information will be very helpful to me. I have uploaded my project (so far) here: http://uploading.com/files/d15133c1/ProjectWork2.zipx/. And also I have uploaded an image of my designed page here: http://lh6.ggpht.com/_7ii6RI_rc38/THlX-byHDMI/AAAAAAAAAIA/jDWqApfjIno/s800/WebPage.jpg so that you can see what my thought is. Thank you.

jpg files will not display in gridview on aspx page

I have an image object in a template of a gridview The datasource of the image object evaluates to the path of the jpg file. However, the aspx page displays a little red x instead of the picture. How do I get the image to display/Frank learning vs 2005

Check Page Referer in Javascript?

Is there a way to execute a javascript function based on the page referer?So if the user comes from an internal page then doesnt execute but if it comes from an external page then it does?Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend