TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amit Kumar
NA
140
41.1k
search with gridview
Jan 24 2014 4:03 AM
i have
gridview
, in i have implemented search option to search the record . but i want to implement one more functionality like
http://i.tinyuploads.com/sWc7KQ.jpg
like how many recoed have been found according to user search .
eg (10 records founds )
here is my code
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="GridviewDiv">
<p>
Enter UserName :
<asp:TextBox ID="txtSearch" runat="server" />
<asp:ImageButton ID="btnSearch" ImageUrl="~/SearchButton.png" runat="server"
Style="top: 5px; position: relative" OnClick="btnSearch_Click" />
<asp:ImageButton ID="btnClear" ImageUrl="~/Clearbutton.png" runat="server" Style="top: 5px; position: relative"
OnClick="btnClear_Click" /><br />
<br />
</p>
<asp:GridView ID="gvDetails" runat="server" Width="332px" AllowPaging="true" AllowSorting="true"
AutoGenerateColumns="false" CssClass="Gridview" PageSize="3" DataSourceID="dsDetails">
<HeaderStyle BackColor="#df5015" />
<Columns>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Name")%>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="City">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("City")%>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sex">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Sex")%>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="dsDetails" runat="server" ConnectionString="<%$ConnectionStrings:connect %>" SelectCommand="select * from emp" FilterExpression="Name LIKE '%{0}%'">
<FilterParameters>
<asp:ControlParameter Name="Name" ControlID="txtSearch" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Reply
Answers (
4
)
id does not exist in curent context
how to copy data of one table into another table