2

I am getting a list of people in a EntityDataSource and binding this to a repeater. I want to order them randomly so the people are not always displayed in the same order. What options do I have to do this?

2 Answers 2

1
 list.OrderBy(x => Guid.NewGuid()) 

should do the trick.

Sign up to request clarification or add additional context in comments.

Comments

0

Heres the code, for anyone interested.

 protected void MyDataSource_QueryCreated(object sender, QueryCreatedEventArgs e) { var members = e.Query.Cast<EntityFramework.Member>(); e.Query = from member in members.OrderBy(x => Guid.NewGuid()) select member; } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.