locked
AccessDataSource on MasterPage - can't reference it from the masterpage RRS feed

  • Question

  • User-182833233 posted

    I have a masterpage which has an AccessDataSource control on it., which I reference on the codebehind page. The purpose of the AccessDataSource is to have a textbox on all pages into which the user can save a memo. (It needs to be availablemon all pages on the website)

    When the masterpage is combined with a content page, though, the AccessDataSource is not recognised.

    Can anyone suggest a way of having a dataentry box on the masterpage?

    Thanks

    Friday, October 26, 2012 5:47 AM

Answers

  • User-182833233 posted

    Thanks Decker,

    Followed the second part of your advice (i.e used findcontrol), and debugged the problem.

    For anyone in the same situation, I found that the AccessDataControl was housed within a parent control. So once I have found the reference to teh parent control, I was able to use the parentcontrol.findcontrol to find the reference to the AccessDataControl which I was then able to bind to without any further problems.

    Thanks for your help.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 27, 2012 1:05 PM

All replies

  • User-1716253493 posted
    you are able to have masterpage code behind.
    Friday, October 26, 2012 6:53 AM
  • User-182833233 posted

    I know you can have code behind on the masterpage. The problem is that the codebehind doesn't recognise the AccessDataSource when it is combined with a Content page.

    Friday, October 26, 2012 7:12 AM
  • User3866881 posted

    Shallb

    Hi,

    I don't suggest you putting any DataSource Control to master page. For if you do this, a data presentation control such as "GridView", "DetailsView" or "FormView" will not recognize where your data source is.

    So you should put them together.——That's a best method;)

    Also you can have a try something like Page.MasterPage.FindControl("AccessDataSourceID") as AccessDataSource and do something binding manually, but that's too complicated and easy to cause problems.

    Reguards!

    Saturday, October 27, 2012 4:35 AM
  • User-182833233 posted

    Thanks Decker,

    Followed the second part of your advice (i.e used findcontrol), and debugged the problem.

    For anyone in the same situation, I found that the AccessDataControl was housed within a parent control. So once I have found the reference to teh parent control, I was able to use the parentcontrol.findcontrol to find the reference to the AccessDataControl which I was then able to bind to without any further problems.

    Thanks for your help.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 27, 2012 1:05 PM