in my web page i am having different hyperlinks for letter a to z and now i want to display all the details in gridview of the names starting with particular letter in my db table on clicking of hyperlink..
plz help its urgent..........
in my web page i am having different hyperlinks for letter a to z and now i want to display all the details in gridview of the names starting with particular letter in my db table on clicking of hyperlink..
plz help its urgent..........
Following 's LinkButton idea and 's href concern, here are practical alternatives, gotchas and quick fixes that solve the common issues reported by .
Use-case options
Security, correctness and performance notes
Always parameterize the query; do not concatenate user input into SQL. Example pattern:
cmd.CommandText = "SELECT Id, Name FROM People WHERE Name LIKE @prefix";
cmd.Parameters.AddWithValue("@prefix", prefix + "%"); Escaping and collation: if names contain accented characters, decide on a collation or normalize input. If users can submit characters that are SQL wildcards, escape them or use an ESCAPE clause.
Indexes & paging: "starts-with" searches (prefix + '%') can use an index; avoid SELECT * and enable server-side paging when the result set can be large.
Accessibility: use clear focus/ARIA and style the active letter. Provide an "Other" link for non A–Z starters.
Troubleshooting checklist
These steps address both the simple QueryString approach and the LinkButton event approach suggested earlier, plus the common pitfalls that cause "it works on first try, then stops" behavior.
Jump to Post— rohand 1I assume, you are using DataList control for Alphabetic heading and you have added link button for each alphabetic letter I mean A, B, C ….Z …
Now, you need to set CommandArgument or CommandName property of link button with the Alphabetic character. Then you need to handle the …
I assume, you are using DataList control for Alphabetic heading and you have added link button for each alphabetic letter I mean A, B, C ….Z …
Now, you need to set CommandArgument or CommandName property of link button with the Alphabetic character. Then you need to handle the OnCommand event of link button.
Now create one function which will accept your clicked alphabetic as argument I mean your function may looks like :
SearchData(string strSearchWord)
{
here your sql query will go and in the where clause you need to pass argument.
i.e. “where name like ' “ + strSearchWord + “%'”
then execute the query and store data in DataTable or DataSet and bind it with your Gridview.
}
========================================================================================
in my web page i am having different hyperlinks for letter a to z and now i want to display all the details in gridview of the names starting with particular letter in my db table on clicking of hyperlink..
plz help its urgent..........
thanks............now it is working
some problem ...can u plz provide some code
in my web page i am having different hyperlinks for letter a to z and now i want to display all the details in gridview of the names starting with particular letter in my db table on clicking of hyperlink..
plz help its urgent..........
Hi deeptakshd
I am thinking Just like as You but i cannot be able to Create A to Z Hyperlinks in my code because hyperlinks demanded (href) value. but i don't want to give that or redirect to other page in asp.net
Will u send me your code of syntax to control this issue.
Thanks in Advance.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.