Hi,
I followed Grid/NestedViewTemplate Relations demo to bind one grid that has a nested view, everything is working properly.
But when using ObjectDataSource as a DateSource for NestedView and that object datasource uses a server side method to pull data from a Session variable, I'm getting
System.NullReferenceException: Object reference not set to an instance of an object
Here is ObjectDataSource declarative markup
and here is server side method
GetFacultyMemberSubmissions() method pulls data from a Session variable. When updating it to not use session, everything is working. So is that something that is related to ObjectDataSource or NestedView binding doesn't accept session variables. Any suggestions?
I followed Grid/NestedViewTemplate Relations demo to bind one grid that has a nested view, everything is working properly.
But when using ObjectDataSource as a DateSource for NestedView and that object datasource uses a server side method to pull data from a Session variable, I'm getting
System.NullReferenceException: Object reference not set to an instance of an object
Here is ObjectDataSource declarative markup
<asp:ObjectDataSource runat="server" ID="MemberSubmissionData" TypeName="FacultyAnnualReview" SelectMethod="BindNestedView"> <SelectParameters> <asp:Parameter Name="SubmissionId" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource>
and here is server side method
public FacultyMemberSubmission BindNestedView(int submissionId) { return ( from data in GetFacultyMemberSubmissions() where data.SubmissionId == submissionId select data ).SingleOrDefault(); }
GetFacultyMemberSubmissions() method pulls data from a Session variable. When updating it to not use session, everything is working. So is that something that is related to ObjectDataSource or NestedView binding doesn't accept session variables. Any suggestions?