.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

Saving Page content

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :SharePoint
Hi All,
            i have a scenario where i need to save a web page content in sharepoint on click of button. I think there might be some JS function available in sharepoint to do this. I am not able to figure out which method does this.

can anyone help me in achieving this

Cheers :)

View Complete Post

More Related Resource Links

When Saving a Page that Contains Javascript, the Content Rendered is Repeated


Each time I save a page that contains javascript, the content rendered is duplicated. For example, I added the following javascript (to display today's date) into a content editor web part:


<script language="JavaScript">
function mdy(todaysdate) {
//calls the function mdy why to get our date
return todaysdate.getMonth()+1+"/"+todaysdate.getDate()+"/"+todaysdate.getYear()
}</script><b><font size="2"><script language="JavaScript">
sampleDate1=new Date()
document.write ("Today's date is "+ mdy(sampleDate1))</script></font></b>


I then click on stop editing. When I go back to edit the page and then click on stop editing, "Todays date is ...." keeps repeating. This happens each time I edit the page.

Has anyone else encountered this problem? If not, do you know what could be causing it?

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

update panel in content page



iam using master page  and i am using update panel in content pages (child pages)

my questions is that can use updatepanel in every child page or  master page only.

give ur suggestions, i have senario , in a page i have file upload concept ,updatepanel

is not support that fileupload.

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

workflows when saving site as template with content

I have have a MOSS 2007 site on a production server with custom workflows.  I saved the site as a template with content and used the template to create a sibling site.  I am testing it and the workflows aren't working.  Is this to be expected? I have read that workflow don't work when saving between development and production, but I can't find anything that addresses both sites being on production. Will I need to recreate the custom workflows by hand? 

external content not load in page like style and js in asp.net mvc when i use area


i am working on a asp.net mvc 2 website who have a area and i have a problem with them.

i use different different url routing for application settings. i have two folder called style

first folder location in main directory  /Style/style.css

second folder location in Area area/style/style.css

everything is work fine in application but when i used style.css from main directory in my area's views then style not worked. when i track them from firebug then i got error "The resource could not be found" but path is correct.

sombody tell me to use absolute path to solve this issue. how i can use absolute path to declare resource url in views.

any suggestion , sollution on this issue who can help me to solve this issue.

Request.PathInfo losing Master Page content and CSS link


Hi All-


I'm using Request.PathInfo to response.redirect as user to a different page ( based on the content after .aspx ).  It redirect just fine however, once redirected, the page loses all content from the master page and the CSS link.  I've searched and can't find an answer. 

Does anyone have a solution for this?

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

bind drop down list in content page from value from master page

Hi all, I have applied nested master page to some page. Now i want to bind drop downlist from value selected in dropdown list in master page of master applied to that page. the hierarchy of pages is  mypage.aspx -> main.aspx -> inner.master I want bind dropdown list in  mypage.aspx from  from value selected in dropdown list in  inner.master Please help me. 

Load content to the page with in XML?

I'd like to find out about the best technique to generate multiple container boxes/thumbnails of the content with xml that are loaded into wrap panel. It can be stackpanels or listboxes with textblocks and checkboxes in them. Any sample or helpful source of information is highly appreciated. Thank you in advance.

inline css within content page

Hello, I have a question for the group.  I have a master page with several content pages I a working with.  On the content pages, I would like to make a few changes, such as adding images inside the content area.  When adding images, there are a few properties, such as borders that I can add.  However, it appears that this has limitations.  When I try to add some CSS at the top of the content page, I get a few errors.  I would like to add things such as padding around the image to make the appearance more presentable.  Can someone recommend how to do this? thanks 

Page has one or more controls that do not correspond with con

I'm posting this in VS 2008 forum since I wasn't getting this error when this was in VS 2005.  It's complaining about my content tags but I have not a clue why, everything looks fine to me.  I've included the master page so what's the deal? <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Sub.master.cs" Inherits="Web.MasterPages.Sub" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title id="Title" runat="server" /> <link id="main_styles" href="~/main.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-image: url(images/back.jpg); } .style1 {color: #B92722} #bigImg { position: absolute; display: none; } </style> </head> <body class="Mainbody"> <form id="form1" runat="server"> <!-- Main Table --> <div class="centered-table"> <table width="100%" border="0" cellspacing="0" cellpadding="0"&g

PageViewerWebPart content url redirects to a full page

I have a many pages that contain the mentiond webpart, and it works swimmingly.  However there are a few links that re-direct and open a full page in the browser, and not in the webpart :( I am fairly sure that there is no way to stop this with out access to the javascript or url (which i may have access to eventually). I am curious if anyone else has experinced this small snafu and what, if any, was your work around. Regards, max   ps i coded and added this in C#, hence the post in the programming sub-forum.

Create buttons for "new item" which create a new page of a specific content type

We have a Pages library (wiki) which supports a few content types (and page layout associated). We want to enable users to click a button for example of "new custom enterprise wiki page" - so a new page of content type article will be open in edit mode. Can someone help how to develop? (it has to mimic the behavior that happens when user creates new page from the Ribbon or Site actions and has to choose the content type, it also has to keep the new page in edit mode and not just create it).  
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