Thursday, June 11, 2009

How to create an Alphabetical Link ??

The Question:

I need to create a list of Alphabetical links (Ex. A B C D E on) which are bound to a Gridview. On click of "A" the GridView should display all records from database starting with Alphabet "A"........and so on.
FYI.....The Links are outside the GridView. so cant use the Alphabetical paging thing.

Is there any generic way to create the links instead of creating 26 diff links and firing as many events??

u can use select statement to select particular data from the databeese
u said thet u click on "A"
so u have to write the code under the "A" botton click event
assume that ur table name was "student " n the columns are sno,name, marks
here the select quiry to select the student name in alphabetical order
suppose u need to select names which are started vth "A" the the select statement was
select name from student where name like ' %A '

I am aware of the Select statement......
My main issue is that i dont want to add 26 for each there a way to generate the links.... ??

why dont u use same event say 'openlink' on click of every button?just pass command name for different button for example for a use onclick='openlink' commandname ='a' and in the event use switch case operation.

Searching For Better Solution!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.