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

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

Redirect Page Layout: relative URL problem with content accessed by multiple URLs

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :SharePoint


I try to use the "Redirect Page" Layout to allow page to redirect to internal (relative url) content.

I ask users to put the URL in relative form: /doclist/docs/myfile.docx but when saved, the value takes the complete domain.


Then when we access the page using multiple URLs, the url is absolute and users can't access content (since I have one URL private for edition and multiple for reading).


Do you have any idea how I can fix this issue?


Thank you,



View Complete Post

More Related Resource Links

spmetal generated class and content type (for page layout) retrieve problem


I'm working with a console application to generate my sites and subsites (hierarchy). And i've got a problem with a generated spmetal class.


this doesn't work:


static void Main(string[] args)


            string SITE = string.Concat("http://"Environment.MachineName);         



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?

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

Create a Page Layout for Enterprise Wiki with content

I need to create a Page Layout that for an Enterprise Wiki Page that already has content in the Rich Text HTML Field so when people go in to create a new page based off of the Page Layout they can go in and just replace the text with their own. Can this be done?

Problem running jquery script in Content Page

Hi!! I have a master page in asp.net and a content page with some basic asp.net controls like textbox,buttons,treeview....i have a jquery script in the content page and reference set to the jquery file..The script changes the text property of a button on the keydown event set for the textbox...the script works fine if i copy and paste it in a normal page...the script only ran once when i worte it for the first time the next day when i tried to run the script it was not working..i m facing this problem for running the script in content page and i a m not aware of how to write jquery script for the content page.. i m really not finding any solution where i am wrong i have even tried setting the internet explorer security setting to low..plz plz plz plz plz plz help me on Thanks!!

have problem to redirect page , on cancel button click



i am doing simple login page and i used to required field validator to validate user name and password text box.

and there are two buttons submit and cancel.

now i want to redirect this page to home.aspx after clicking on cancel button, but that two required fields validator get pop up and i get stuck in login page.

 if anyone knows how to solve this problem please tell me..

thanks, in advance for your valuable time. 

Master Page/Content Page - Multiple Submit Buttons / ViewModels ? Best practise?



I wanted to ask, what would be the best mvc practice to get the following result:

I want to create a mvc website with one master page and several content pages.

There are some parts on the master page (besides the header and footer) on the left side, that should be available on every content page.

So I guess it makes sense to put that stuff inside the masterpage. These things are several panels. There is one panel with a search field and a search button. Another panel should retrieve data from an own viewmodel, that displays content related data to the user.... and there are another 2 similar panels.

So I thought I could create for those 4 "panels" 4 parial strongly typed views with their own ViewModels. Then implement them with RenderPartial on the Masterpage.

But I realized, that this causes a lot of problems in mvc. First I realized, that I am having problems that the viewmodels behind the partial views are different to the viewmodels of my content pages.

Then I realized that I have anyways problems with more than one submit button. I read now a lot of different solutions on similar cases and now I really dont know, what would be a very "pretty" solution for my case.

I think this is not something very rare that someone is having a searchbox with a search button shared for all pages, because I read

Cannot Edit Multiple Publishing Html Fields (Additional Page Content Fields)



I’ve added new Columns of type HTML, I’ve added these columns to my content type and the follow in my page layout:

<div id="featureArea">

<PublishingWebControls:RichHtmlField ID="rhfFeatureArea" FieldName="FeatureArea"

Change Content Type then Change Page Layout of an Existing Page


One of our content managers has added about 10 new web pages but has used the wrong page layout.  The site that these pages are in has 3 options of page layout that can be used.  They are:

(WDC Article) One Column-Std
(WDC Article) Two Column-Std
(WDC News) Public Notices and News

As you can see, there are 2 content types within the site.  The content manager has used the "(WDC Article) One Column-Std" page layout instead of the "(WDC News) Public Notices and News" page layout.

I have tried to edit the page layout via the 'Page Settings and Schedule' area but I only get the "(WDC Article) One Column-Std" and "(WDC Article) Two Column-Std" page layout options - there is no option to select "(WDC News) Public Notices and News".

I have tried to change the page content type from WDC Article to WDC News so I will have the "(WDC News) Public Notices and News" page layout option but it keeps reverting back to WDC Article or I get an error.

Any ideas of how I can change all pages that use "(WDC Article) One Column-Std" page layout to "(WDC News) Public Notices and News" page layout (the correct layout)?

Thanks :)

Redirect to other page problem


I am trying to redirect to a .aspx page from a controller within my application using following method

return Redirect("~/Asp.aspx"); 

but its not working can anyone tell me what is the reasion.


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.



Problem with multiple content sources

We now having a problem with the search on SharePoint 2007, we created multiple content sources on the SharePoint Farm. The issue is we define few search scope and setup with different sub-site on it. After run the new scope the log show it crawled all other sub-site item outside the scope.

Customize content query web part in custom page layout


I am trying to build a custom page layout which should have the following web parts:

1. Announcements,

2. Doc Library

3. custom list items

And the data in these web parts should be from the site in which we create this page. For example, if we try to create a page in site A, then the announcements displayed should be from site-A, doc lib that is in site-A...

And I am trying to insert a content query web part in the page layout using sharepoint designer, and modify the query to insert the announcements list in the site. But how can I query to pull the data from corresponding site.

Thanks for the help.

Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

WebDev.WebServer.exe has encounted a problem and needs to close when trying to view page in browser


Hi, whenever I load an aspx page in vwde2008, I get the message in the subject of this post.  After I click Ok on that, I get a dialog box, Unable to Connect to the ASP.Net development center.  What can I do to troubleshoot?

I am using Windows XP SP3, vwde2008 with SP1, on a HP desktop.  Also using Office 2003 if that is relevant at all.

Thanks, Justin

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