Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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" %>
share|improve this answer
    
Strange.. copy/pasted your code in VS2010 and the warning is still there. –  Wim Hill Jan 28 '11 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 '11 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 '11 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 '11 at 2:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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