0

I have the following WhereParameters for LinqDataSource1 in my .aspx file:

<WhereParameters>
    <asp:Parameter Name="key1" Type="String" />
    <asp:Parameter Name="key2" Type="String" />
    </WhereParameters>

How do I assign values to these parameters in my code behind? Thanks.

user776676
  • 4,265
  • 13
  • 58
  • 77

1 Answers1

2

You can assign them in the code behind like this:

LinqDataSource1.WhereParameters["Key1"].DefaultValue = "1";
LinqDataSource1.WhereParameters["Key2"].DefaultValue = "2";

Hope this helps.

Tim
  • 28,212
  • 8
  • 63
  • 76