I want to update one LinqDataSource with a record retrieved from a different DataContext. The problem is that the DataContext of the LinqDataSource doesn't seem to be made public so I can't get access to it to attach the new object to the DataSource's context.
What is the normal way of doing this? Or should I just scrap the LinqDataSource
Good reason for that - you can't share objects across different DataContexts.
If you use the LinqDataSource's OnContextCreating event you can attach the correct instance to the data source [ie, that which the second entity is retrieved from] so they're both from the same DataContext:
ASPX:
C#: