web 2.0

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender - The QueryExtender enables data from a data source to be filtered without an explicit Where clause in the data source.

ShotDev Focus:
- ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Tag Control :


<asp:QueryExtender ID="QueryExtender1" runat="server"></asp:QueryExtender>

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

On current project Right Click -> Add New Item

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Select LINQ to SQL Classes

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Click Yes . for Move code to folder ‘App_Code’

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

On Server Explorer Database Connections.

Read more go to : ASP.NET(vb.net) & LinqDataSource - asp:LinqDataSource

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Drag GridView Control to ASP.NET Web Form. On GridView Tasks -> Choose  Data Source -> <New data source…>

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Choose a Data Source Type -> LINQ and input Specify an ID for the data source.

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Choose a Context Object.

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Select an Table from LinqDataSource.

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Result on ASP.NET Web form from GridView & LinqDataSource.

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Create search textbox and search button.

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Drag QueryExtender to Web Form

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

Create this code to Web Form (Code View)

Example Code

QueryExtender.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="QueryExtender.aspx.vb" Inherits="QueryExtender" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" />

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="CustomerID" DataSourceID="LinqDataSource1">
<Columns>
<asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True"
SortExpression="CustomerID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="CountryCode" HeaderText="CountryCode"
SortExpression="CountryCode" />
<asp:BoundField DataField="Budget" HeaderText="Budget"
SortExpression="Budget" />
<asp:BoundField DataField="Used" HeaderText="Used" SortExpression="Used" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="mtDataClassesDataContext" EntityTypeName=""
TableName="customers">
</asp:LinqDataSource>

<asp:QueryExtender ID="QueryExtender1" TargetControlID="LinqDataSource1" runat="server">

<asp:SearchExpression DataFields="CustomerID" SearchType="StartsWith">
<asp:ControlParameter ControlID="TextBox1" />
</asp:SearchExpression>

</asp:QueryExtender>

</div>
</form>
</body>
</html>

QueryExtender.aspx.vb

Partial Class QueryExtender
Inherits System.Web.UI.Page

End Class

Screenshot

ASP.NET(vb.net) & QueryExtender - asp:QueryExtender

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.