Koray Durudogan
Koray Durudogan

Reputation: 634

take a float from codebehind and use it in view

I need to make an filter operation in the view of my project.

<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=ETicaretEntities1" DefaultContainerName="ETicaretEntities1" EnableFlattening="False" EntitySetName="BookTable" EntityTypeFilter="BookTable" 
        where ="it.[BookSales] > 1.6"></asp:EntityDataSource>

This code works fine but i need to take that 1.6 from codebehind. In summary i need to take a float from codebehind and use it in view side. Thank you for your time !

Upvotes: 0

Views: 39

Answers (1)

Koray Durudogan
Koray Durudogan

Reputation: 634

satisOrtalama was the float i wanted to use and this code did the trick:

string satisOrtalamaFormated = satisOrtalama.ToString().Replace(",", ".").Replace(".", ".");         
EntityDataSource1.Where = "it.BookSales > " + satisOrtalamaFormated;

Upvotes: 1

Related Questions