Default.aspx page reverting

I am the administrator for a custom SharePoint application.  The application is developed in-house.  There appears to be an issue with one of our current solutions.  The solution should be updating the default.aspx page under the STS template.
 It appears that when I deploy this solution, it works fine for a short time - however, at some point in time, the default.aspx page under "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\sts" reverts,
and the default page that came shipped with sharepoint returns.
The shipped custom default.aspx adds a custom zone to the page layout, and the result is that any user who has placed a web part in the zone has their web part shifted to another zone, messing up the page layout.
At the suggestion of the development team, I copied in the default.aspx from the solution file.  This corrected the issue - but again, it was only for a short time.  I go back and look now and it has reverted back to the same date/filesize, etc.
as a backup I took of the default.aspx before deploying the one from the solution.
Is there a way that I can update the SharePoint content DB with the appropriate default.aspx, after deploying it manually?  I think what is happening is that the SharePoint content DB is deploying it's copy from the database - so i would like to update
the database so that the solution deployed default.aspx becomes the authoritative copy.
Thank you

Because Microsoft may at any time override your changes with any patch (e.g. security hotfix, Cumulative Update, Service Pack) and you're back to where you've started.
It is just bad development practice, as well.
Trevor Seward
Follow or contact me at...
&nbsp&nbsp
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Similar Messages

  • Change the Page title of Default.aspx in SharePoint Hosted App using ECMA Script

    Basically i want to change page title dynamically. the thing is default.aspx page is present in the below location
    Folders/Pages/Default.aspx ( Verified using
    SharePoint Manager 2013 Online )
    Could any one let me know how to iterate through the folders and then go to pages and change title of Default.aspx page?
    Navaneeth

    All the links which is mentioned above is either they are doing it in code behind or javascript like document.title.
    I want to change dynamically using ECMA script. the point i found here is if you use the below code you will get an error saying list "Pages" does not exists in the SharePoint site.
    clientContext.Web.Lists.GetByTitle("Pages");
    So i am wondering how can we change the page title of SharePoint hosted app ( Default.aspx) dynamically
    Say example i have one text box and submit button. when give the title in the text box and click on submit  the title should reflect in the page.
    Navaneeth

  • Restored SP2010 site "broken" in an odd way - home.aspx is not accessible, but default.aspx is.

    So we are testing out a 3rd party backup and recovery tool. The testing for individual pages and list items went pretty well. However, we are seeing really odd behavior when attempting to recover the sites. Obviously we will be working with the vendor on
    the issue from their side of things.
    I just don't know if there is something that we might have configured oddly that might be contributing to the issue.
    I created a from scratch test site using the team template on our SP 2010 service pack 2 farm.
    We have an F5 load balancer handing traffic off two 2 web front end servers, with two application servers behind the scenes along with a sql server.
    The product backed up the content, then I deleted the site so that we could test the restore ability.
    There are a number of problems that we see right off the bat when trying to recover a site.
    1. The Site Pages/Home.aspx appears to have a problem - attempting to access it creates an error page that the ULS describes as:
    Timestamp             
    Process                                
    TID         Area                         
    Category                     
            EventID               
    Level                    
    Message             
    Correlation
    04/10/2014 10:50:29.92 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Logging Correlation Data     
             xmnv    
    Medium              
    Name=Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Logging Correlation Data     
             xmnv    
    Medium              
    Site=/sites/IT     a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Monitoring                   
    b4ly        High      
    Leaving Monitored Scope (PostResolveRequestCacheHandler). Execution Time=7.44193745294444               
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Runtime                      
    tkau       Unexpected      
    System.FormatException: Input string was not in a correct format.   
    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)    
    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)    
    at System.Convert.ToInt32(String value, IFormatProvider provider)    
    at Microsoft.SharePoint.Utilities.SPUtility.CreateSystemDateTimeFromXmlDataDateTimeFormat(String strDT, Boolean fPreserveMilliseconds)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.SafeFieldAccessor.GetDateTimeFieldValue(SPItem item, String fieldName)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.<RetrieveInternal>b__0(SPItem item)    
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() ...            
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected       ...   
    at System.Linq.Enumerable.<ExceptIterator>d__92`1.MoveNext()    
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)    
    at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.ConvertItemType(IEnumerable`1 items)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.DefaultCalendarListAccessor.Retrieve(String selectedDate, String scope, Dictionary`2 entityInfo)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarService.CreateStartupResponse(ICalendarAccessor accessor, Dictionary`2 parameters, String viewType, String selectedDate)    
    at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.CreateStartupData(String viewType, String selectedDate)    
    at Microsoft.SharePoint.Appl...              
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected               
    ...icationPages.WebControls.AjaxCalendarView.CreateBodyOnLoadScript(SPWeb web)    
    at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.OnPreRender(EventArgs e)    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStag...               
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected       ...esAfterAsyncPoint)   
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14)                    0x13DC SharePoint Foundation        
            Monitoring                                   
    b4ly        Medium               Leaving Monitored Scope (Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)).
    Execution Time=50.8621207443963               a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    2. What we did find was a
    http://myfarm/sites/IT/d27/col/SecondTestSite/default.aspx page that displayed what SitePages/Home.aspx used to be.
    However, that page is not marked as the home page. I know I can mark that page as the home page to get around the problem - but why would the original page not load any longer? I tried going into the Site Pages library and the how to use the featurees page
    still works okay - just not the home page.
    I also am finding that the them of the site was lost, a workflow attached to a list was lost - I don't just mean one instance of the workflow; the list no longer has a workflow attached to it. Also the default view of a calendar part on the front page was
    lost.
    Is this common for SharePoint site recoveries - to lose various fundamental settings?
    I am just wondering whether this sounds like something site specific or if it sounds like every other recovery out there.
    Thank you

    Hi,
    According to your description, my understanding is that the error occurred when you used a 3rd party backup and recovery tool.
    I recommend to use Backup-SPSite and Restore-SPSite command to see if the issue still occurs.
    If not, then the error should be regarding to the 3rd party tool, you need to get help from the experts who are professional at the 3rd party tool.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Opening a aspx page on IFrame in SharePoint online

    Hi I m developing an app for SharePoint Online 2013. I want to open a aspx page (from my project ) on a Iframe as follows. 
    Default.aspx page as follows 
    <button type="button" id ="Button1" name="Button1">Click Me!</button> 
    <iframe name ="frame1" id ="frame1"  width="800" height="800" runat="server" ></iframe>
    App.JS File as follows 
    $(document).ready(function () {
    $("#Button1").click(function() {
        redirectPage();
    function redirectPage() {
    document.getElementById("frame1").src = "/Pages/Default1.aspx";
    This is not working can someone please help me. Thanks.
    d.n weerasinghe

    Hi,
    Thank you very much for your reply. I have managed to work it as you mentioned I had to remove the "Runat server".
    But Still I cannot display a SharePoint page on a Iframe.
    I m tryng to do this
    <li><a OnCLICK="document.getElementById('frame1').src = 'https://xxxx-my.sharepoint.com';" >Personal Address</a></li>
    Then I get the following error
    "To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame"
    I have added the following code to mysite.master page on the saharepoint , still now working . Any help please.
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <WebPartPages:AllowFraming  runat="server" __WebPartId="{D6E530AE-958F-4E81-B06F-AA5AC60DFF94}" />
    d.n weerasinghe

  • How to modify default.aspx in sharepoint 2007

    I am new in the SharePoint and I am working in a project has two English and French websites.
    I have a subside in both English and French websites are using a calendar web part.
    But, as the theme used in the English site is different to the French one, the Calendars colors are different.
    I got the default.aspx pages are using different style sheet files in the header so my assumption is that I can change the link of style sheets in the default.aspx French site to be the same as English one and then the calendar's color would be the same too.
    (It should be mentioned I compared both of calendar.css files are the same but core.css files are different)
    However, I don't know how can I get the default.aspx page to edit or which permission do I need to have or SharePoint designer must be installed in my machine or any extensions in the web server?
    Also, I tried to edit the masterpage in the sharepoint designer but it gives me below error:
    This type of page is not served.
    Server Error in '/' Application.  This type of page is not served.    Description: The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.master' may be incorrect.   Please
    review the URL below and make sure that it is spelled correctly.   Requested URL: /_catalogs/masterpage/default.master  Version Information: Microsoft .NET Framework Version:2.0.50727.3649; ASP.NET Version:2.0.50727.3648  
    Please help me to solve my problem.
    Thanks.

    Default.aspx is stored in the "root" of each site.  Can you advise if you want to change the styling and colours or just the content. 
    If it's content you want to change, edit rights and the Site Actions --> Edit Page will be sufficient.  You'll see slightly different things depending on if you're in a publishing site or not but it's easy enough to add copy from here.
    If you want to make changes specifically for one page, you can consider copying the masterpage, giving it a relevant name and then setting that as the master page for the site level (not the site collection level). 
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Unable to remove ??? this line from default.aspx using powershell

    Trying to open the default.aspx page using powershell script
    $file =  $spSourceWeb.GetFile("default.aspx")
     $datastring = [System.Text.Encoding]::ASCII.GetString($file.OpenBinary()) 
    in the content I am getting three ??? char because of this site is breaking . how to avoid this or remove .please provide your suggestion on this .
    sarav

    I am tring to download the default.aspx page from subsite  then remove some bad reference from default.aspx then then again planning to update.
    My code here
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
      Add-PSSnapin Microsoft.SharePoint.PowerShell;
    try
        #set the admin url
        $sourceWebURL = "My url"   
        $spSourceWeb = Get-SPWeb $sourceWebURL
        $file =  $spSourceWeb.GetFile("default.aspx")   
        if ($file.ForceCheckout)
            $file.CheckOut()
        #download files
        $datastring = [System.Text.Encoding]::ASCII.GetString($file.OpenBinary())     
        $strFinder = '<%@ Register TagPrefix="WpNs1" Namespace="BD.Evolve.DHFQueryWebPart" Assembly="BD.Evolve.DHFQueryWebPart, Version=1.0.0.0, Culture=neutral,    PublicKeyToken=709ed70a96eaa5cb"%>'
        $strReplace =''   
       # Need to replace ???
        $strFinder1="???"
        #Write-Host $strFinder1    
        #$datastring=$datastring -Replace($strFinder1,$strReplace)
        $datastring=$datastring -Replace($strFinder,$strReplace) 
        $file.SaveBinary([System.Text.Encoding]::ASCII.GetBytes($datastring))   
        if($file.CheckedOutBy.LoginName -eq 'my adminid')
         $file.CheckIn('myadminid');
        Write-Host $datastring
    catch
            Write-Host "error "+$error[0]
    sarav

  • How to attach a default master page to a aspx site page ?

    Hi
    I make a aspx file in the sharepoint designer 2013, and I place a hyperlink inside the form.
    It do well
    Then I try to attach a master page.
    In the sharepoint designer menu I click at the style button, then click at the attach button and select
    the default master page "oslo"
    But when I open the site in the internet browser, the site comes with an error.
    Below here is the code before and after attaching the master page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@ Page Language="C#" %>
    <%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta name="WebPartPageExpansion" content="full" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled 2</title>
    <meta http-equiv="X-UA-Compatible" content="IE=10" />
    <SharePoint:CssRegistration Name="default" runat="server"/>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:HyperLink runat="server" id="HyperLink1">HyperLink</asp:HyperLink>
    </form>
    </body>
    </html>
    %@ Page Language="C#" masterpagefile="~masterurl/custom.master" title="Untitled 2" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
    meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
    <%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content id="Content1" runat="Server" contentplaceholderid="PlaceHolderUtilityContent">
    <form id="form1" runat="server">
    <asp:HyperLink runat="server" id="HyperLink1">HyperLink</asp:HyperLink>
    </form>
    </asp:Content>

    Hi,
    According to your post, an error occurred when you added the master page to a aspx site page.
    Please do as follows:
    1. Use "~sitecollection/_catalogs/masterpage/custom.master" instead of "~masterurl/custom.master" .
    2. Remove the form tag.
    Code:
    <%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~sitecollection/_catalogs/masterpage/custom.master" MainContentID="PlaceHolderMain" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
    <asp:HyperLink runat="server" id="HyperLink1">HyperLink</asp:HyperLink>
    </asp:Content>
    Best Regards
    Dennis Guo
    TechNet Community Support

  • SharePoint Breadcrumbs, Getting Page names to show up instead of Default.aspx

    Hello, I have the following code in my masterpage placeholder TitleBreacrumb
    <asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server" RenderCurrentNodeAsLink="True">
    <NodeStyle CssClass="ms-sitemapdirectional" />
    </asp:SiteMapPath>
    It renders SiteName > Pages > Default.aspx  
    I would like it to render SiteName > Welcome  
    I use multiple pages currently, and not subsites.
    How can I hide "Pages" and show "Page Title" instead of filename.extention in my breadcrumbs?
    Thanks,
    -Eric Schrader
    -Eric

    I know this is kinda old but this code worked for me.
    <div id="breadcrumbcustom">
    <asp:SiteMapPath ID="contentMap"
    runat="server"
    SiteMapProviders="SPContentMapProvider"
    RenderCurrentNodeAsLink="false"
    HideInteriorRootNodes="false"
    SkipLinkText="" />
    </div>

  • Why do my appearance add-ons disappear and my custom home page revert to default whenever I close Firefox?

    These items work fine and stay functional when I keep the browser open, but as soon as I close it, then open it later, the appearance add-ons disappear from my add-ons list and my home page reverts to the default.

    It is possible that there is a problem with the file(s) that store the extensions registry.
    Delete the files extensions.* (e.g. extensions.sqlite, extensions.ini, extensions.cache) and compatibility.ini in the Firefox profile folder to reset the extensions registry.
    https://support.mozilla.org/kb/Profiles
    New files will be created when required.
    See "Corrupt extension files":
    http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    https://support.mozilla.org/kb/Unable+to+install+add-ons

  • Using Aspx page insted of default portal page

    Hi,
    Is there a way to add aspx page in a portal.
    After login I want aspx page to display hosted on different domain instead of portal default page.
    Thanks in advance.

    Oh, I see the misunderstanding. The EXE you talk about is your LV built application - not related to ASP.NET. Okay...
    What you want to look up in your LV docs is "remote front panels". This allows you to either embed a dynamically generated image of the VI into the HTML or actually the front panel itself (requires the RTE on the client machine). The second form means the display is interactive. Unfortunately, the only web server supported for this right now is the LV web server. However, you could do some tricks to get the image (option #1 of RFP) from a LV server and then post it up on the IIS server.
    For example, you could create a little LV application that uses the IE control in LV to hit the LV web server, grab the page and then save it in the IIS virtual directory.
    You other questions...
    5. Manage to get your C# code to VB.NET.
    I'm not a VB.NET programmer so I can only tell you what you need to do...The PumpMessages dll is C++ so that isn't going to change. To call it from VB.NET, you need to create a DllImport statement. Trying to convert what is in the MSDN sample, it should be something like
    <DllImport("C:\Inetpub\wwwroot\MyWebApp\bin\MyLVApp.dll", EntryPoint := "LVDLLStatus", _
       ExactSpelling := True, _
       CallingConvention := CallingConvention.Cdecl)> _
    Public Shared Function MoveFile(errStr As IntPtr, errStrLen As Integer, module As IntPtr) As Integer
        ' Leave function empty -
    End Function
    The other code just calls it. You need to create a VB.NET class with a static constructor (the static Global() in my example), static member (Thread) and static method (ThreadProc).
    6. Even though there were few explanations on this area from you  this summer , I was not quite clear or to follow  .
    Was there any workaround in this area from you on this.
    I am not sure what you are asking here..I said of lot of stuff over the summer *grin*, just reply with the specific question
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    Hello all,
    Could you possibly help me with provider-hosted app development/deployment process.
    We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
    In AppManifest.xml that we are deploying we have key instead of explicit URL:
    <App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
    SharePointMinVersion="15.0.0.0">
      <Properties>
        <Title>SomeTitle</Title>
        <StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
    If we use as
    https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
    /_layouts/appinv.aspx
    So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
    What did I miss?
    P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.

    hi,
    to deploy provider hosted app you need 2 things
    1. Client ID
    2. Redirect URL.
    What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
    Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
    inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
    Now if you upload this file it will work.
    To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
    public static class AppPackageHelper
    public const string StartUrlExpression = "{0}?{1}";
    public const string StandardToken = "{StandardTokens}";
    public static string Publish(string appPath, string ClientId,string StartUrl)
    string tempDir = string.Empty;
    string outPutFile = string.Empty;
    try
    string parentDir = System.IO.Path.GetDirectoryName(appPath);
    outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
    tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
    Directory.CreateDirectory(tempDir);
    int lastInd = appPath.LastIndexOf('.');
    string tempPath = string.Empty;
    string targetFilePath = string.Empty;
    string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
    FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
    File.Copy(appPath, cabPath);
    XDocument doc = null;
    string appManifest = string.Empty;
    using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
    appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
    ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
    manifestEntry.ExtractToFile(appManifest);
    doc = XDocument.Load(appManifest);
    XNamespace ns = doc.Root.GetDefaultNamespace();
    string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
    doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
    doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
    doc.Save(appManifest);
    if (manifestEntry != null)
    manifestEntry.Delete();
    zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
    int totEnt = zipArch.Entries.Count;
    for (int e = 0; e < totEnt; e++)
    if (zipArch.Entries[e].Open().Length == 0)
    //if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
    //zipArch.CreateEntry(zipArch.Entries[e].FullName);
    File.Delete(appManifest);
    if (File.Exists(outPutFile))
    File.Delete(outPutFile);
    File.Move(cabPath, outPutFile);
    return outPutFile;
    catch
    throw;
    finally
    if (System.IO.Directory.Exists(tempDir))
    System.IO.Directory.Delete(tempDir, true);
    return outPutFile;
    using System.IO.Compression.FileSystem.dll.
    Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
    So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
    if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
    on searching.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • How to customize default login page of FBA

    Hi,
    I have implemented a SharePoint 2013 Portal with Form Based Authentication.
    I want to customize the look and feel of default login page.
    How could i do that?

    Hi,
    For your requirement, you can take a look at the three links below for a quick start:
    http://sivarajan.me/post/SharePoint-2013-Enabling-Custom-Login-Page-and-Mixed-Contents-Part-2
    http://blogs.msdn.com/b/kaevans/archive/2010/07/09/creating-a-custom-login-page-for-sharepoint-2010.aspx
    http://mysharepointsolution.wordpress.com/tag/custom-login-page/
    What’s more, The deafult login page is located here: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\IDENTITYMODEL\LOGIN\default.aspx, you can
    make a copy and modify it.
    Thanks
    Patrick Liang
    TechNet Community Support

  • Question about including JQuery in a Survey list DispForm.aspx page

    In SharePoint 2010, I was able to hide the links for editing, deleting... an existing survey entry in the DispForm.aspx page using the following technique:
    1 - Save jquery .js file to the Style Library in the top level site
    2 - Save the .js file that has the jquery code to hide the link in the Style Library in the top level site
    3 - Reference the .js files in the DispForm.aspx page like this:
    <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
     <script type="text/javascript" language="javascript" src='<asp:Literal runat="server" Text="<%$SPUrl:~SiteCollection/Style Library/jquery-1.5.0.min.js%>"'></script>
     <script type="text/javascript" language="javascript" src='<asp:Literal runat="server" Text="<%$SPUrl:~SiteCollection/Style Library/hideedit.js%>"'></script>
    </asp:content>
    The hideedit.js file contains the following:
    $(document).ready(function(){
        $('#ctl00_m_g_d3bec7ca_bd25_448d_8874_da35856854c5_ctl00_ctl01_ctl00_toolBarTbl').hide();
    I am trying to use this same technique in SharePoint 2013 but it is not working.
    It appears that neither of the js files are loading properly.
    As a test, I put the following in the hideedit.js:
    alert('test');
    $(document).ready(function(){
        alert('from jquery');
    Neither of the alerts are displayed when navigating to the DispForm.aspx file.
    How do I get JQuery loaded in a survey DispForm.aspx file in SharePoint 2013?

    Have you tried this within Designer?  Copy the DispForm, edit it and add the JD references below the PlaceHolderMain section and then save.  Set this as the default Displat Form and your changes should load.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Change content of default.aspx for subsites using Powershell

    Hi.
    I need to update the content of the default.aspx of 60+ subsites in a site Collection. I am able to loop all subsites and get the corresponding default.aspx files using a PowerShell snippet like:
    $site = Get-SPSite -WebApplication https://mysite.domain.no/ -Limit All
    $wc = $site.allwebs | where {$_.url.StartsWith(https://mysite.domain.no/sites/blahblah/blahblahblah) }
    foreach ($web in $wc){
    $file = $web.GetFile("default.aspx")
    The problem is I don't know whether to use the Set-Content command-let or an XMLDocument approach.
    I have the file With the correct content on the local machine. I tried With $file.Parentfolder in order to use
    $f = $web.GetFolder($file.ParentFolder)
    $fc = $f.files
    Get-ChildItem "C:\temp\default.aspx" | foreach {
    $spFileCollection.add($($_.Name),$_.OpenRead(), $true)
    to replace the file but this gives an error on empty folder. Can I use this approach or is there a way to change the actual content of the file?

    Hi Jorgen,
    According to your description, my understanding is that you want to update the page content using PowerShell.
    I suggest you read the content data like below:
    $data = $file.OpenBinary()
    $encode = New-Object System.Text.ASCIIEncoding
    $test = $encode.GetString($data)
    Then you can change the string you want, and then you can save it using SaveBinary() method.
    Here are some detailed articles for your reference:
    Reading the contents of a SharePoint library file using PowerShell
    Using powershell to read/modify/rewrite sharepoint xml document
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Call a javascript function (in ASPX) page from a javascript file

    I have a javascript file (viewer.js) situated in Scripts/viewer.js My
    default.aspx has a javascript functions that calls a c# function in the
    default.aspx.cs ( it sends a http webrequest)
    Now I want to call from the viewer.js the function in default.aspx which calls the c# function.
    How can I handle this in my viewer.js?
    I need to do this because I work with 3D objects and the select event is on the viewer.js
    When I select the 3D object it needs to call the function in default.aspx...
    Scripts/viewer.js
    function ClickPickItem(item) {
    $("#properties").show();
    /*Call function App() */
    Default.aspx
    function App() {
    PageMethods.Connect(callback);
    Default.aspx.cs
    [WebMethod]
    public static string Connect()
    string rsp = DigestAuthFixer.GrabResponse("http://<username>:<password>@nextbus.mxdata.co.uk/nextbuses/1.0/1");
    ... CODE TO MAKE HTTPWEBREQUEST}
    Sorry if I'm not clear enough
    I don't see another option like this
    What I need to do?
    Thanks!

    If my understanding is not wrong, you are trying to call a Javascript function in a separate script block from a linked Javascript page. rite?
    When it comes to Javascript, all scripts will be posted to the client side browser and we can access any method between pages provided those JS files are linked to the page.
    So you can directly call
    App()
    function from your
    ClickPickItem()
    function.
    Please try and let us know your result.

Maybe you are looking for

  • I have an external hard drive that shows up in disk utility but Verify and Restore are greyed out.

    I have an external hard drive that shows up in disk utility but Verify and Restore are greyed out. I am trying to determine what is wrong with the drive. I need the data on the drive and it won't show up in Disk Warrior. I have tried different Mac's

  • App approved but not showing up in itunes

    My app was approved on October 7, 2014 and is not showing up in the itunes store. How can this problem be resolved.

  • RMI related NotSerializableException problem

    Hi, I am attempting to write a distributed chess player program. I've written a ChessServer class that all clients register with before they can play (which keeps track of how many clients are connected). Each clients creates an instance of a ChessSe

  • Function SAVE_TEXT

    Hello! I am using this function in order to save text in sales order. When i pass the table lines to the function it has for example 4 lines. After saving i can see that the 4 lines where concatenated to each other. I want to create a situation where

  • System Purge in Batch Mode

    It was found that only online mode of system purge of deleted or expired items was found under a page group, Is there any means for purging the items in batch mode, say for a monthly batch job ? Any api call/script available ?