Set the ContextTypeName for all controls on a page RRS feed

  • Question

  • User961784352 posted

    I have a landing page that sits outside of the dynamic data folder (I'm replacing the default.aspx).

    I'll have about a dozen dynamic data hyperlinks on the page.

    Is there a way I can set the ContextTypeName for the entire page so I don't have to add this tag to every control?

    Right now I have to specify my dbml context on each control i place on the page.

    I tried setting a public static variable from code-behind & referencing it on the aspx page, but it wouldn't take it when I tried to load the page.

    It was taking my variable referenced code literally inside the contexttypename tag instead of actually grabbing the variable.


    Saturday, February 19, 2011 4:28 PM


All replies

  • User3866881 posted

    Not very sure about your question very clearly because of not seeing your codes.

    I think you can create a Default.aspx page, where there's something to set the ContextTypeName property, and then all of your other pages should inherit from that page.

    Hope this helps:)

    Sunday, February 20, 2011 8:18 PM
  • User-330204900 posted

    hi there, are you adding your own navigation to the Page? if so have a look at my articel here SiteMapProvider for Dynamic Data (.Net 3.5 SP1 and...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 24, 2011 10:46 AM