Good afternoon all.
I have a page that displays data in a gridview based upon what the user selects for a material in a radiobutton list and how many they wish to see, a text box.
Upon logging into this page, a session variable for MemberID is created, MemberKey.
What I would like to do is pass this session variable into the LINQ statement so that only the specific member that has logged in sees their data:
ContextTypeName="VDSWeightsReportingService.CompleteWeightsDataContext" EnableInsert="True"
EnableUpdate="True" TableName="tblOnlineReportingCOMPLETEWEIGHTSFINALDEMOs"
Where="MaterialText == @MaterialText && Productpriority <= @Productpriority && MemberId == @MemberId">
<WhereParameters>
<asp:ControlParameter ControlID="radMaterial" Name="MaterialText"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="tbxHowMany" Name="Productpriority"
PropertyName="Text" Type="Int32" />
<asp:SessionParameter Name="MemberId" SessionField="MemberKey"
Type="String" />
</WhereParameters>
</asp:LinqDataSource>
I have tried to insert the session variable as above but without the LINQ no longer seems to go through the motions.
Can someone point out to me where I am going wrong?
If this doesn’t work, or is not possible, can someone advise of a way around this? i.e. using this session variable in the LINQ where clause.
Make sure you select the correct session variable!!!!