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 have a custom aspx page in my SharePoint 2010 WCM site. Data is pulled from a list into a DataTable and alot of the fields are then bound to the page using the Eval method. Rather than using strings directly in the aspx page I have defined the strings in a class which encapsulates all my methods regarding a particular list. e.g.

<asp:Literal ID="progimage" runat="server" Text='<%# Eval(Programme.Fields.ProgImage) %>'/>

This works in testing and worked in production until the client upgraded to SP1. Now we are getting the message:

Error - A call to Bind was not well formatted. Please refer to documentation for the correct parameters to Bind.

Using strings directly works fine e.g. Eval("Title")

Can anyone explain why it may have stopped working all of a sudden? I've upgraded the test site to SP1 but can't recreate the problem. It does run with considerably lower security. Programme is a public static class. The field are defined like this:

public static class Programme
{
    public static class Fields
    {
        public static string ID = "ID";
        public static string Title = "Title";
        //etc
    }

They are still successfully accessed from the page's code behind file, only the aspx is a problem.

Any help appreciated.

share|improve this question
    
I think you'd have to read the release notes of SP1 to see if anything changed with regards to databinding. Sorry, can't offer more than RTFM :-) –  Fox Dec 13 '11 at 6:27
    
Not sure it caused by SP1. Try to force recompilation of the aspx by editing it(you can open page,insert space and save).I assume you have this page in file system. –  Amit Kumawat Dec 13 '11 at 8:42
add comment

1 Answer 1

Thanks for you comments

The answer was actually to add the PageParserPaths section to web.config so that server side scripting was enabled as per http://blogs.msdn.com/b/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx

I have absolutely no idea why it worked before the upgrade as I don't remember the client ever adding that block.

share|improve this answer
add comment

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.