0

I would like to use SharePoint User Controls in my custom application pages.
In VS2010 I've created a new project and added an application page.

I've added the follow Tagprefixes in my customapp.aspx page:

<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="/_controltemplates/InputFormSection.ascx" %>

When I try to add an InputFormSection in the content section,
I get the warning and the page throws an error when loading:

Element 'InputFormSection' is not a known element.
This can occur if there is a compilation error in the Web site,
or the web.config file is missing.

Did I miss to add something? Putting a ~ in scr="~/_controltemplates... did not change anything.

1 Answer 1

0

You definitely need the ~/.

Here is a page i have built that you can reference:

http://spc3.codeplex.com/SourceControl/changeset/view/56394#1012106

<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
4
  • Strange.. copy/pasted your code in VS2010 and the warning is still there.
    – Wim Hill
    Jan 28, 2011 at 12:37
  • Does the file exist on disk? C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES. Do you have similar imports as the one in the example project?
    – djeeg
    Jan 28, 2011 at 12:51
  • Files are all there, imports the same... I ran another test and my code compiles and the page is displayed correctly... Only not to happy with the warnings which are still there.. A VS2010 bug?
    – Wim Hill
    Jan 28, 2011 at 13:57
  • oh i understand now, its just a visual studio warning. ignore those. you are developing the developing the web part as a control library (dll), so visual studio doesnt know how to bind a "web" path "~/_controltemplates"
    – djeeg
    Jan 29, 2011 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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