when this page deploy through share point designer and show preview in browser

<%@ Register TagPrefix="DataEntities" Namespace="SPTestHnG.DataEntities" Assembly="SPTestHnG.DataEntities, Version=, Culture=neutral, PublicKeyToken=41ad28f78052d808" %>
<%@ Register TagPrefix="Entities" Namespace="SPTestHnG.Entities" Assembly="SPTestHnG.Entities, Version=, Culture=neutral, PublicKeyToken=ec50151247608ae4" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="PlaceHolderMain">
    <link rel="Stylesheet" type="text/css" href="/_layouts/Blue.css" />

while remove <asp:content>...</asp:content> tag work fine,so what's the issue in asp control


Unexpected error might be anything, You need to see what is the root cause of the Error,

1) Open the Web.Config file of the IIS SharePoint WebSite 2) Search for the CallStack and change it to CallStack="true" 3) Search for the CustomError and change it to CustomError="Off" 4) Browse the page you will get to know the actual issue that causes the error You yourself can rectify it , it might be as simple as missing file.


There are many reason to system tell us unexpected error. Asp control reference is not set to the registry. and that is most possible reason as per your code.

I can give you the suggestion to change in some changes as below.So you can get such hint regarding error.

Step 1:

The first step we need to take is to the change the web.config in the virtual directory of the web application which should ideally be present under a path similar to this : inetpub\wwwroot\wss\Virtual directories folder[Central Admin PortNo]\web.config

Inside this web.config we should the following entry mode . This attribute will be having a value "On" . We need to change it to "Off" . Make sure you type it in the same way , the words are case-sensitive.

Step 2:

Next we need to find an attribute CallStack in the same web.config as above . This will be having a value of "false". We need to go ahead and change it to "true".

Step 3(Optional) :

Next we need to find an attribute Debug . It should be having the value "false" by default . Go ahead and change this to "true".

So the 3 changes are : CustomErrors=”Off” instead of the default CustomErrors=”On” CallStack=”true” instead of the default CallStack=”false” Debug=”true” instead of the default Debug=”false”

So System give you correlation id and redirected to the error page.

Tell me if answer is feasible and help you out.

  • I know all that things, but all you get "unexpected" error @dipen – Amit Koyani Dec 11 '15 at 8:34
  • I will get back to you after doing detail research . @amit Koyani – Dipen Shah Dec 11 '15 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.