.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

adding javascript breaks default page layout in vwd 2010

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

I'm putting together my first project in vwd 2010 and I'm starting with the default settings for a web form project.  I'm trying to add an external js file to a content page that inherits from the default master page.   When I add my .js file to the page, the navigation links, which normally display horizontal, desplay like a vertical list.  If I comment out the code then it displays ok.  

Here's how I'm adding my file in the code behind:

    protected void Page_Load(object sender, EventArgs e)
        if (!ClientScript.IsClientScriptBlockRegistered("getNewWord"))
            ClientScript.RegisterClientScriptBlock(this.GetType(), "getNewWord",
            "<script language=javascript src='Scripts\\getNewWord.js'>");   

 The navigation markup in the master page looks like this:

            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                        <asp:MenuItem NavigateUrl="~/Home.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>

View Complete Post

More Related Resource Links

Adding a custom control to the SharePoint 2010 Team Site Wiki Page Template ( wkpstd.aspx ) programm

Topic This is maybe my last post about the Team Site Wiki Page customization with the aim of exceeding its limitations. This time we are going to customize the unique template ( wkpstd.aspx) by replacing the control that renders the editable content by a custom one. In this post example, we will take advantage of the use of this custom control to render not editable additional contents, for instance, a header and a footer that could be the same for a specific Wiki Page Library. Of course, we are not going to really customize the template, but we are going to use a delegate control to replace the control at runtime. Here are the screen shots of the result: We can see a non editable Header and Footer on the Team Site Wiki Page In edit mode these additional contents are not rendered, but we can add new content as usual And of course, after having saved the page, the new content is rendered wtih the non editable Header and Footer. Steps required   If you look at the Team Site Wiki Page template, wkpstd.aspx, you can see the control that is rendering the editable content/ <SharePoint:EmbeddedFormField ID="WikiField" FieldName="WikiField" ControlMode="Display" runat="server" /> We are first going to create a custom EmbeddedFormField control Then, we are going to use a delegate control to replace the native EmbeddedFor

adding quicklinks/tree navigation to main search page (search 2010 express)

Hi Just installed Search Server 2010 Express (full version). On the previous version you could add the top link bar to the search page to easily allow you to browse to other sections i.e contacts. With 2010 I cannot seem to add any kind of navigation away from this main page (default.aspx). Using Designer it will not allow me to edit the top bar, quick launch, tree view and top link bar have been enabled with links however they do not show up on the main search page. can someone help ?

Javascript error when attempting to switch page layouts in SharePoint 2010

I hope I put this in the correct forum. I am experiencing the following error when attempting to change the layout of an existing SharePoint 2010 page. But it does not seem to happen on all page types, just publishing pages. This error is happening on both the development server and both test servers. I have look in to the logs, since if it a javascript error there was nothing, which would be expected but I had to try. I have look at the cui.js file but was unable to spend enough time trying to figure out what exactly is going on in this file. Error being received ... Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Tue, 7 Sep 2010 21:10:54 UTC Message: Object required Line: 2 Char: 6422 Code: 0 URI: http://devintranet2010.myconexus.ca:85/_layouts/cui.js?rev=wvoVpqlQb30nGo4DjDk8Kg%3D%3D   If anyone has any ides or can point me in a direction that will allow me to productively continue my investigation, the information would be greatly appreciated. Regards Kyle

Creating Page Layout Sharepoint 2010 Publishing

I am trying to create a custom Page layout (3 fixed columns with webzones 1 for content (content editor) and other 2 for adding web parts here is my aspx, please some one help me out, as tha webpart slides below another if it exceeds the width <%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %> <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly=&qu

Can't inherit default page layout on a publishing site?

  Hi,   Implementing SharePoint for the first time.   We've got a page layout that we want to use as a default. We've got it set as the default in the top site in the site collection. However, when I create a Publishing Site with Workflow, it doesn't default to using the right layout, despite the fact the sub-site's Site Settings / Page Layouts show that it it set to inherit the default page layout from its parent.   Oddly, when I create another type of site, e.g. a Blank Site, it does inherit the default layout.   Any suggestions?   :|Ben      

Admin page to manage users, need help with adding roles to this layout


Currently i have a page that has the following  code / layout.. as it is now, i am only displaying the roles and they cant be edited. Since this would be the admin page to manage users, what i would like is to have the Roles display as a checkbox list that shows all our roles and have the roles that the user is assigned to checked. Can that be done, if so are there any examples or tutorials i can review?


            <asp:GridView ID="GridView1" runat="server"  AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="UserName" DataSourceID="ObjectDataSource1" AllowSorting="True" Width="80%">
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
                    <asp:CheckBoxField DataField="IsOnline" HeaderText="IsOnline" ReadOnly="True" SortExpression="IsOnline" />
                    <asp:CheckBoxField DataField="IsLockedOut" HeaderText="IsLockedOut" ReadOnly="True" SortExpression="IsLockedOut" />
                    <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly=&quo

Adding JavaScript to Default.aspx


Hi there,

I am relatively new to SharePoint Designer and want to add a piece of JavaScript code that I have used before on standard HTML websites but I am not 100% sure where to put the code on the page.

I tried already and got an error so I have removed the code and the page works as standard.

Below is the code I inserted to a webpartzone (right) replacing the &nbsp; which was already there.

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 300, 220, 0, 7000, 1)

The main script is very long so I hadnt pasted it in but i placed it at the top of the page (when in code view). Here it is below:

What am i doing wrong?

The Commish

<script type="text/javascript"> 
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/rotate01.jpg", "", "

How to create a custom page layout in sharepoint foundation 2010



I need to create a custom page layout in sharepoint foundation 2010.

I am aware that wss 3.0 and sharepoint foundation do not have the publishing infrastructure.

I need to know if the same procedure that is used to create custom web part pages in WSS 3.0 is to be used in SharePoint foundation too or are there other ways.

I am relatively a fresher to sharepoint technology.Please help.

Thanks in advance:D.


InfoPath 2010: Create custom "Table Templates" and "Page Layout Templates"


Is it possible to create your own table templates and/or page layout templates for InfoPath 2010?


How to set default Image to RichFieldImage control in custom Publishing Page layout in Site defini




How to set  default Image to RichFieldImage control  in custom Publishing Page layout in Site definition?


Adding Left Navigation Bar on page layout separetly

Dear TechNet Team,

I'm applying an HTML design onto a sharepoint site, and everything is going fine, but the design of the masterpage indicates that the left navigation bar (current navigation) shouldn't appear in the masterpage,  that's okay, but the inside page layouts should include the current navigation bar, how can i do that?, would you please guide me step by step?

Thank You In Advance,,,


SP Foundation 2010 not displaying my default site page...



I'm new to Sharepoint and have successfully installed Sharepoint Foundation 2010 on a Windows 7 x64 machine using the instructions on MSDN (instructions are fantastic; by the way).  However, when i completed executing psconfigui.exe (Sharepoint Products and Technologies Configuration Wizard) my default site was not displayed as mentioned in the setup instructions.

Instead I got a webpage cannot be found (HTTP 404) error.  The URL displayed was "http://kweeks-dell"; which doesn't seem right to me.

I was able to run the Central Administration console and display various admin tasks; however, when i tried to create a new site (i.e. "http://kweeks-dell:10178/MyFirstSite"), I get an error message "URL Name contains illegal character ':'".  Where 10178 is part of the URL of the admin site.

I'm really confused cuz i don't see any problems with my installation but yet i cannot get a site setup that i can start work with.

Anyone, I'd appreciate any help I can get.




Adding a JavaScript to SharePoint Page with SharePoint Designer


I am trying to add a javascript to a single SharePoint page. This script will only be used on this one page so I do not want to put it in the master page. I saved the the scritp to a document library on my site. Using SharePoint Designer, I opened the page on which the script should reside. I put the tag script tag at the first place I could. When I save the page, I get this error:

Content in the embedded form field may be changed by the server to remove unsafe content. Do you want to reload your page to see the results of the save?

After clicking Yes, the script tag is gone. How do I add this script to my page?

Set default Page Layout using Feature Stapling in SharePoint Site



I need to create custom SharePoint Feature using Visual Studio to set Default Page Layout for the publishing pages created in publishing site/ sub-sites.

Can you please guide me steps to create the custom feature using Visual Studio and how to deploy the same in the site.


Abhijit Sil

Is there a site page default.master in SharePoint Server 2010??



I inserted a few lines of code on the wkpstd.aspx template to "show" the document library properties on each wiki page within each wiki page library. This is working fine, except that the property Document ID
is showing up on site pages as well.  I checked Moss 2007 and I foumd that there is a bpcf.aspx default page that is used to create a basic page. Is there a separate template or master page for the site pages within 2010 that i can modify?

Any help or suggestion is greatly appreciated. Thanks.


Adding the Content Editor Web Part to a SharePoint Layout .aspx page



we've created a layout page that contains the Rich Text Editor web part. But the client requires a web part that allows the embedding of audio/video files. The Rich Text Editor strips out the objects when we try to embed them.

I've used the Content Editor Web Part to add audio and video files (by manually adding the web part to the page), but I can't find the definition for that web part to include it in the layout page so that the client doesn't need to manually add the web part themselves to every page that requires it. (Which could be many pages.)

Any help would be appreciated.



Set as default master page in Sharepoint Designer 2010 does not change pages at all


I make a copy of V4.masterpage ,rename it as myv4.masterpage, and modify it .

then right-click myv4.masterpage and choose 'set as default masterpage'.

but when i open my site, the pages don't change, and create a new page,it still the old look.


Shouldn't it do that?

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