take a float from codebehind and use it in view

44 Views Asked by At

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 !

1

There are 1 best solutions below

0
Koray Durudogan On

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;