creativeedg10 — 2011-05-02T08:45:57-04:00 — #1
I have a long list of dynamic data being generated on a jquery mobile site. I'd like to have this data be separated by alphabet list bars, much like the directory organization of a phone by first letter. (ex: jQuery Mobile: Demos and Documentation)
Another option would simply be to only call the data by first letter. For example, I select the letter "A", and all the data that starts with "A" displays.
I am calling names via ASP.NET.vb repeated method with: <%# Eval("Name")%>
That code of course pulls all names. How can I narrow it down to specific letter starts? I am new to ASP and ASP.NET; therefore, I'm not quite sure where to start or what terminology to start researching. Any help would be greatly appreciated, thank you.
pufa — 2011-05-04T06:12:00-04:00 — #2
Where is the data coming from? In what type... plain old ado.net (DataTables, DataReader), web service, linq to *, file ...
linq is great for this type of stuff.
select foo from bar where foo.Name.StartsWith("A");
"SELECT * FROM FOO WHERE NAME LIKE @p" with @p = 'A%'
creativeedg10 — 2011-05-04T08:35:43-04:00 — #3
Thanks for your help pufa,
I am pulling content from a Microsoft SQL database.
It is just being read via a Repeater.
My current set up can be seen below:
What do you think?
I appreciate your help.
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource1">
<div data-role="collapsible" data-collapsed="true">
<p>Room: <%# Eval("Room")%></p>
</div><!-- /collapsible set-->
ramanbasu — 2012-05-04T02:20:37-04:00 — #4
You must be using sql statement in your SqlDatasource1. If so or no, try using "SELECT Name, Room FROM [your table] WHERE NAME LIKE 'A%' ". Later, you can replace your SQL with dynamic value for 'A', 'B' etc. Do not fetch all the data from database and filter on client side.
Providing full source can be of much help.
mittineague — 2014-09-17T23:09:20-04:00 — #5
This topic is now archived. It is frozen and cannot be changed in any way.