PDA

View Full Version : صفحه بندی repeater?



boysilent
چهارشنبه 21 دی 1390, 14:34 عصر
با سلام:
دوستان کسی هست راهنمایی کنه
که واسه repeater صفحه گذاشت؟؟؟

hamid_shrk
چهارشنبه 21 دی 1390, 14:48 عصر
تو یک تاپیک من یک سمپل گذاشتم / سرچ کنید

boysilent
چهارشنبه 21 دی 1390, 14:59 عصر
فک کنم سمپلت واسه data list بود ؟//
واسه ریپینر میحوام

hamid_shrk
چهارشنبه 21 دی 1390, 15:12 عصر
فرقی نداره عمل paging مثل هم هست.
جای متغیری که واسه دیتا لیست تعریف کردم اسم آی دی ریپیتر رو بزار

alonemm
چهارشنبه 21 دی 1390, 16:05 عصر
یک مثال عملی میتونید با repeater پیاده سازیش کنید:
http://barnamenevis.org/showthread.php?322558-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%BE%DB%8C%D8%A7%D8%AF%D9%87-%D8%B3%D8%A7%D8%B2%DB%8C-Custom-Paging-%D8%AF%D8%B1-GridView-%D8%A8%D8%A7-%D8%AA%DA%A9%

boysilent
پنج شنبه 22 دی 1390, 13:33 عصر
اقا پیداکردم ولی یه خطا میده.... فک کنم دیتا سورسششو ارور میده نه؟؟



public partial class _Default : System.Web.UI.Page
{
private void GetData()
{

//----------------------------------------- Part 1

DataTable dt = new DataTable();

using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=wordha;Integrated Security=True"))
{
SqlCommand cmd = new SqlCommand("select * from wlogin", con);

SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Open();

da.Fill(dt);

con.Close();
}

//----------------------------------------- Part 2

PagedDataSource Pd = new PagedDataSource();

Pd.DataSource = dt.DefaultView;
Pd.AllowPaging = true;
Pd.CurrentPageIndex = CurrentPage;
Pd.PageSize = 4;

Repeater1.DataSource = Pd;
این قسمت خطا میده Repeater1.DataBind();

//----------------------------------------- Part 3

Button4.Enabled = !Pd.IsFirstPage;
Button5.Enabled = !Pd.IsLastPage;

}
public int CurrentPage
{
get
{

object o = this.ViewState["_CurrentPage"];
if (o == null)
return 0;
else
return (int)o;
}

set
{
this.ViewState["_CurrentPage"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
{

if (!IsPostBack)
{

GetData();

}



/////////////////////////////////

protected void Button4_Click(object sender, EventArgs e)
{
CurrentPage += 1;
GetData();
}
protected void Button5_Click(object sender, EventArgs e)
{
CurrentPage -= 1;
GetData();
}





اینم خطاشه

{"Both DataSource and DataSourceID are defined on 'Repeater1'. Remove one definition."}

crazy_1892
جمعه 23 دی 1390, 20:57 عصر
روش که من استفاده می کنم که تعداد رکوردی که می خواهی نمایش بدی را تقسیم بر تعداد کل رکورد کنی و با استفاده از دستورات html به صورت تگ A تعداد لینک هاتو در پایین repeater ایجاد کنی
و با استفاده از query string oخیلی وارد page هات بشی

int Page = 0;
string Show = "";
int count = query.Count();

if (count > tedad)
{
Page = count / tedad;
if (count % tedad > 0)
Page = Page + 1;
Show = "شماره صفحه:<br /><table><tr>";
for (int i = 1; i <= Page; i++)
{
Show += "<td><a href='nNews.aspx?Page={0}'>{0}</a>|</td>";
Show = string.Format(Show, i);
if (i % 20 == 0)
Show += "</tr><tr>";
}
Show += "</tr></table>";
}
return Show;
}

crazy_1892
جمعه 23 دی 1390, 21:00 عصر
بعد رشته show در Literal نمایش بده
البته فکر نمی کنم روش صحیحی باشه ولی کار شما را راه میندازه
دارم یه صفحه بندی جدید ایجاد می کنم که فکر می کنم استاندارد بالاتری داشته باشه

boysilent
جمعه 23 دی 1390, 23:03 عصر
دوستان عزیز برنامه نویس asp اون خطایی که نوشتم نمیدونید براچیه


روش که من استفاده می کنم که تعداد رکوردی که می خواهی نمایش بدی را تقسیم بر تعداد کل رکورد کنی و با استفاده از دستورات html به صورت تگ A تعداد لینک هاتو در پایین repeater ایجاد کنی
و با استفاده از query string oخیلی وارد page هات بشی

int Page = 0;
string Show = "";
int count = query.Count();

if (count > tedad)
{
Page = count / tedad;
if (count % tedad > 0)
Page = Page + 1;
Show = "شماره صفحه:<br /><table><tr>";
for (int i = 1; i <= Page; i++)
{
Show += "<td><a href='nNews.aspx?Page={0}'>{0}</a>|</td>";
Show = string.Format(Show, i);
if (i % 20 == 0)
Show += "</tr><tr>";
}
Show += "</tr></table>";
}
return Show;
}


داداش این چیه نوشتی ؟؟؟البته مشکل از منه اخه اماتورم .ببخشید

crazy_1892
جمعه 23 دی 1390, 23:10 عصر
count=تعداد رکورد هایی که از دیتابیس می خونه
tedad=تعداد رکوردی که می خوای در صفحه نمایش بدی
page=تعداد صفحات

boysilent
جمعه 23 دی 1390, 23:21 عصر
count=تعداد رکورد هایی که از دیتابیس می خونه
tedad=تعداد رکوردی که می خوای در صفحه نمایش بدی
page=تعداد صفحات
ایول اقا این بعدش مشکلش چی هست که میگین استاندارد نیست؟

crazy_1892
جمعه 23 دی 1390, 23:31 عصر
مشکلی نداره خودم فکر می کنم خوب نیست چون تا حالا ندیدم کسی استفاده کنه

boysilent
جمعه 23 دی 1390, 23:46 عصر
مشکلی نداره خودم فکر می کنم خوب نیست چون تا حالا ندیدم کسی استفاده کنه

ریپیتر هم باید باشه دیگه آره //گاری به ریپیتر نداره؟؟؟

crazy_1892
شنبه 24 دی 1390, 02:03 صبح
نه از این روش هم برای repeater و هم گریدویو و... می تونی استفاده کنی

sarapepors
شنبه 24 دی 1390, 08:56 صبح
اقا پیداکردم ولی یه خطا میده.... فک کنم دیتا سورسششو ارور میده نه؟؟



public partial class _Default : System.Web.UI.Page
{
private void GetData()
{

//----------------------------------------- Part 1

DataTable dt = new DataTable();

using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=wordha;Integrated Security=True"))
{
SqlCommand cmd = new SqlCommand("select * from wlogin", con);

SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Open();

da.Fill(dt);

con.Close();
}

//----------------------------------------- Part 2

PagedDataSource Pd = new PagedDataSource();

Pd.DataSource = dt.DefaultView;
Pd.AllowPaging = true;
Pd.CurrentPageIndex = CurrentPage;
Pd.PageSize = 4;

Repeater1.DataSource = Pd;
این قسمت خطا میده Repeater1.DataBind();

//----------------------------------------- Part 3

Button4.Enabled = !Pd.IsFirstPage;
Button5.Enabled = !Pd.IsLastPage;

}
public int CurrentPage
{
get
{

object o = this.ViewState["_CurrentPage"];
if (o == null)
return 0;
else
return (int)o;
}

set
{
this.ViewState["_CurrentPage"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
{

if (!IsPostBack)
{

GetData();

}



/////////////////////////////////

protected void Button4_Click(object sender, EventArgs e)
{
CurrentPage += 1;
GetData();
}
protected void Button5_Click(object sender, EventArgs e)
{
CurrentPage -= 1;
GetData();
}





اینم خطاشه

{"Both DataSource and DataSourceID are defined on 'Repeater1'. Remove one definition."}
باسلام . این خطا به این خاطر هست که شما دو تا datasource رو به ریپیتیر بایند کردید.

boysilent
شنبه 24 دی 1390, 12:12 عصر
روش که من استفاده می کنم که تعداد رکوردی که می خواهی نمایش بدی را تقسیم بر تعداد کل رکورد کنی و با استفاده از دستورات html به صورت تگ A تعداد لینک هاتو در پایین repeater ایجاد کنی
و با استفاده از query string oخیلی وارد page هات بشی

int Page = 0;
string Show = "";
int count = query.Count();

if (count > tedad)
{
Page = count / tedad;
if (count % tedad > 0)
Page = Page + 1;
Show = "شماره صفحه:<br /><table><tr>";
for (int i = 1; i <= Page; i++)
{
Show += "<td><a href='nNews.aspx?Page={0}'>{0}</a>|</td>";
Show = string.Format(Show, i);
if (i % 20 == 0)
Show += "</tr><tr>";
}
Show += "</tr></table>";
}
return Show;
}


این خیلی باحاله ولی چطوری به ریپیتر وصلش کنم
البته الان جواب میه کوئری هم گرفتم ج میده

اگه یه while بزارم و تو شرطش بزارم count
بعدش رییپیتر رو اجرا کنم چطوره؟
البته چطوری باید ریپیتر رو فرا خوانی کزد
repeater1.????

crazy_1892
شنبه 24 دی 1390, 14:05 عصر
بخش دریافت اطلاعات از بانک

DataClassesDataContext LL = new DataClassesDataContext();
var query = (from c in LL.news1s
where c.status == true
select c);


بخش اعمال به یک repeater

Literal1.Text = MyClass.Paging(tedad, query);
if (Page.RouteData.Values["Page"]!= null)
{
Repeater2.DataSource = NewsK.GetNews((int.Parse(Page.RouteData.Values["Page"].ToString()) - 1) * tedad, tedad);
Repeater2.DataBind();
}
else
{
Repeater2.DataSource = NewsK.GetNews(0, tedad);
Repeater2.DataBind();
}


من از routing هم استفاده کردم اشتباهت نندازه

boysilent
شنبه 24 دی 1390, 14:20 عصر
من از دیتا سورس اثتفاده کردم این خیلی مفهئمش سنگینه برای من اماتور؟اینطور نیست/

اقا فایل پروژمو ذخیره کردم ببین دادا خودت/شرمنده دیگه

crazy_1892
شنبه 24 دی 1390, 17:06 عصر
من پروژتو نگاه کردم
مشکلت چیه؟؟
درون صفحه Default.aspx کارت درست بود
فقط باید دیتا را هم از طریق Eval نمایش بدی

boysilent
شنبه 24 دی 1390, 17:17 عصر
اره درسته ولی صفحه بندیش کار نمیکنه /
یعنی وقتی اجرا میگنی باید چهارتا رکورد رو نمایش بده ورفتی صفحه دوم هم بقیشو نشون بده که اینجاش مشکل داره
متغیر دادن با eval رو بلدم فقط همین repeater رو موندم چطوری وصل کنم؟

crazy_1892
شنبه 24 دی 1390, 17:26 عصر
DataClassesDataContext Cld = new DataClassesDataContext();
var query = (from C in Cld.news1s
orderby C.Id descending
where C.status==true

select C).Skip(StartIndex).Take(Count);


startindex =شماره صفحه *تعداد نمایش
Count=نمایش هر صفحه

دستور select شما هم باید اینجوری پیاده میشه

boysilent
شنبه 24 دی 1390, 17:35 عصر
[QUOTE=crazy_1892;1418328]
DataClassesDataContext Cld = new DataClassesDataContext();
var query = (from C in Cld.news1s
orderby C.Id descending
where C.status==true

select C).Skip(StartIndex).Take(Count);


/QUOTE]
این کد ها برام خیلی نامفهومه بخدا
الان var query چی هست؟
c.id

یا این NewsK.GetNews((int.Parse(Page.RouteData.Values
نمیدونم چیه تا حالا به گوشم نخورده
بعدش databind بکر کنم مخصوص dataliste????

crazy_1892
شنبه 24 دی 1390, 17:42 عصر
دوست عزیز این یک select است به زبان linq
اGetNews هم یک تابع است که در کلاس NewsKاست.
شما یک select به شکل زیر بنویس

Select * From News Where Id BitWeen StartIndex And StartIndex+Count

boysilent
شنبه 24 دی 1390, 17:53 عصر
?
اوکی بعدش سلکت رو بجای کوری بنویسم


Literal1.Text = MyClass.Paging(tedad, query);


اینجا اره؟فقط همینه دیگه تموم میشه/

crazy_1892
شنبه 24 دی 1390, 19:54 عصر
شما رشته show را برابر با literal قرار بده
این همون تابع صفحه بندی است

boysilent
شنبه 24 دی 1390, 23:34 عصر
سلام//بالاخره درست شد فقط یه مشکل داره این paggeremon ?
sالبته با دیتا لیسته؟

public partial class _Default : System.Web.UI.Page
{
private void GetData()
{

//----------------------------------------- Part 1

DataTable dt = new DataTable();

using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=wordha;Integrated Security=True"))
{
SqlCommand cmd = new SqlCommand("select * from wupload", con);

SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Open();

da.Fill(dt);

con.Close();
}

//----------------------------------------- Part 2

PagedDataSource Pd = new PagedDataSource();
Pd.DataSource = dt.DefaultView;
Pd.AllowPaging = true;
Pd.CurrentPageIndex = CurrentPage;
Pd.PageSize = 4;

DataList1.DataSource = Pd;
DataList1.DataBind();

//----------------------------------------- Part 3

cmdprev.Enabled = !Pd.IsFirstPage;
cmdnext.Enabled = !Pd.IsLastPage;

}
public int CurrentPage
{
get
{

object o = this.ViewState["_CurrentPage"];
if (o == null)
return 0;
else
return (int)o;
}

set
{
this.ViewState["_CurrentPage"] = value;
}
}

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetData();
}


وقتی میره به صفحه بعد دیگه نشون نمیده؟
بعدش میخواستم ببینم میشه بوردرهای دور دیتا لیست رو حذف کرد؟

alonemm
یک شنبه 25 دی 1390, 13:05 عصر
باسلام:
در پاسخ به شما باید بگم که این روش هم از نظر سرعت کارایی بالایی ندارد و تمامی رکوردها داره واکشی میشه.
به مقاله زیر برید:
http://barnamenevis.org/showthread.php?322558-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%BE%DB%8C%D8%A7%D8%AF%D9%87-%D8%B3%D8%A7%D8%B2%DB%8C-Custom-Paging-%D8%AF%D8%B1-GridView-%D8%A8%D8%A7-%D8%AA%DA%A9%D9%86%D9%88%D9%84%D9%88%DA%98%DB%8C-Ajax

boysilent
یک شنبه 25 دی 1390, 15:36 عصر
دوستان من میخومطالبی رو تو وب نشون بدم تعدادش روز به روز زیاد میشه باارسال مطالب/شما چه کنترلی رو پیشنهاد میکنید .
data list
repeater
greid vied
تعداد مطالب نمایش دهنده در صفحه اول 8 تا؟
البته یکم با صفحه بندی lrepeater مشکل دارم؟
راهنمایی

alonemm
یک شنبه 25 دی 1390, 15:42 عصر
دوست من :
نوع کنترل بایند زیاد در سرعت فرقی نمیکنه مهم روش واکشی داده از پایگاه داده میباشد.

boysilent
یک شنبه 25 دی 1390, 15:47 عصر
دوست من :
نوع کنترل بایند زیاد در سرعت فرقی نمیکنه مهم روش واکشی داده از پایگاه داده میباشد.

ممنون ؟؟؟؟

مثلا چه راهی بهتره؟؟؟

boysilent
یک شنبه 25 دی 1390, 16:02 عصر
کسی میتونه این صفحه رو توضیح بده خیلی باحاله فقط spیعنی چی؟
منی که دیتا بیس ساختم و دارم باید چطوری اعمال کنم؟
http://how2learnasp.net/article.aspx?code=b3a4d7da-5557-47cc-b6a2-31d8b7a69272

alonemm
یک شنبه 25 دی 1390, 16:54 عصر
ممنون ؟؟؟؟

مثلا چه راهی بهتره؟؟؟

در مقاله ای که لینکشو براتون گزاشتم واکشی داده به تعداد نیاز گفته شده.
http://barnamenevis.org/showthread.php?322558-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%BE%DB%8C%D8%A7%D8%AF%D9%87-%D8%B3%D8%A7%D8%B2%DB%8C-Custom-Paging-%D8%AF%D8%B1-GridView-%D8%A8%D8%A7-%D8%AA%DA%A9%

alonemm
یک شنبه 25 دی 1390, 17:00 عصر
کسی میتونه این صفحه رو توضیح بده خیلی باحاله فقط spیعنی چی؟
منی که دیتا بیس ساختم و دارم باید چطوری اعمال کنم؟
http://how2learnasp.net/article.aspx?code=b3a4d7da-5557-47cc-b6a2-31d8b7a69272

درکل SP مخفف کلمه Stored Procedures به معنای فارسی رویه ذخیره شده میباشد.
و در این قسمت ما در خود پایگاه داده عملیات و کوئری رو اجرا میکنیم و از نظر سرعت و امنیت بهینه تری دارد.



A stored procedure is a group of Transact-SQL statements compiled into a single execution plan.

Microsoft® SQL Server™ 2000 stored procedures return data in four ways:

Output parameters, which can return either data (such as an integer or character value) or a cursor variable (cursors are result sets that can be retrieved one row at a time).

Return codes, which are always an integer value.

A result set for each SELECT statement contained in the stored procedure or any other stored procedures called by the stored procedure.

A global cursor that can be referenced outside the stored procedure.
Stored procedures assist in achieving a consistent implementation of logic across applications. The SQL statements and logic needed to perform a commonly performed task can be designed, coded, and tested once in a stored procedure. Each application needing to perform that task can then simply execute the stored procedure. Coding business logic into a single stored procedure also offers a single point of control for ensuring that business rules are correctly enforced.

Stored procedures can also improve performance. Many tasks are implemented as a series of SQL statements. Conditional logic applied to the results of the first SQL statements determines which subsequent SQL statements are executed. If these SQL statements and conditional logic are written into a stored procedure, they become part of a single execution plan on the server. The results do not have to be returned to the client to have the conditional logic applied; all of the work is done on the server. The IF statement in this example shows embedding conditional logic in a procedure to keep from sending a result set to the application:

IF (@QuantityOrdered < (SELECT QuantityOnHand
FROM Inventory
WHERE PartID = @PartOrdered) )
BEGIN
-- SQL statements to update tables and process order.
END
ELSE
BEGIN
-- SELECT statement to retrieve the IDs of alternate items
-- to suggest as replacements to the customer.
END
Applications do not need to transmit all of the SQL statements in the procedure: they have to transmit only an EXECUTE or CALL statement containing the name of the procedure and the values of the parameters.

Stored procedures can also shield users from needing to know the details of the tables in the database. If a set of stored procedures supports all of the business functions users need to perform, users never need to access the tables directly; they can just execute the stored procedures that model the business processes with which they are familiar.

An illustration of this use of stored procedures is the SQL Server system stored procedures used to insulate users from the system tables. SQL Server includes a set of system stored procedures whose names usually start with sp_. These system stored procedures support all of the administrative tasks required to run a SQL Server system. You can administer a SQL Server system using the Transact-SQL administration-related statements (such as CREATE TABLE) or the system stored procedures, and never need to directly update the system tables.

Stored Procedures and Execution Plans

In SQL Server version 6.5 and earlier, stored procedures were a way to partially precompile an execution plan. At the time the stored procedure was created, a partially compiled execution plan was stored in a system table. Executing a stored procedure was more efficient than executing an SQL statement because SQL Server did not have to compile an execution plan completely, it only had to finish optimizing the stored plan for the procedure. Also, the fully compiled execution plan for the stored procedure was retained in the SQL Server procedure cache, meaning that subsequent executions of the stored procedure could use the precompiled execution plan.

SQL Server 2000 and SQL Server version 7.0 incorporate a number of changes to statement processing that extend many of the performance benefits of stored procedures to all SQL statements. SQL Server 2000 and SQL Server 7.0 do not save a partially compiled plan for stored procedures when they are created. A stored procedure is compiled at execution time, like any other Transact-SQL statement. SQL Server 2000 and SQL Server 7.0 retain execution plans for all SQL statements in the procedure cache, not just stored procedure execution plans. The database engine uses an efficient algorithm for comparing new Transact-SQL statements with the Transact-SQL statements of existing execution plans. If the database engine determines that a new Transact-SQL statement matches the Transact-SQL statement of an existing execution plan, it reuses the plan. This reduces the relative performance benefit of precompiling stored procedures by extending execution plan reuse to all SQL statements.

SQL Server 2000 and SQL Server version 7.0 offer new alternatives for processing SQL statements. For more information, see Query Processor Architecture.

Temporary Stored Procedures

SQL Server 2000 also supports temporary stored procedures that, like temporary tables, are dropped automatically when you disconnect. Temporary stored procedures are stored in tempdb and are useful when connected to earlier versions of SQL Server. Temporary stored procedures can be used when an application builds dynamic Transact-SQL statements that are executed several times. Rather than have the Transact-SQL statements recompiled each time, you can create a temporary stored procedure that is compiled on the first execution, and then execute the precompiled plan multiple times. Heavy use of temporary stored procedures, however, can lead to contention on the system tables in tempdb.

Two features of SQL Server 2000 and SQL Server 7.0 eliminate the need for using temporary stored procedures:

Execution plans from prior SQL statements can be reused. This is especially powerful when coupled with the use of the new sp_executesql system stored procedure.

Natively support for the prepare/execute model of OLE DB and ODBC without using any stored procedures.
For more information about alternatives to using temporary stored procedures, see Execution Plan Caching and Reuse.

Stored Procedure Example

This simple stored procedure example illustrates three ways stored procedures can return data:

It first issues a SELECT statement that returns a result set summarizing the order activity for the stores in the sales table.

It then issues a SELECT statement that fills an output parameter.

Finally, it has a RETURN statement with a SELECT statement that returns an integer. Return codes are generally used to pass back error checking information. This procedure runs without errors, so it returns another value to illustrate how returned codes are filled.
USE Northwind
GO
DROP PROCEDURE OrderSummary
GO
CREATE PROCEDURE OrderSummary @MaxQuantity INT OUTPUT AS
-- SELECT to return a result set summarizing
-- employee sales.
SELECT Ord.EmployeeID, SummSales = SUM(OrDet.UnitPrice * OrDet.Quantity)
FROM Orders AS Ord
JOIN [Order Details] AS OrDet ON (Ord.OrderID = OrDet.OrderID)
GROUP BY Ord.EmployeeID
ORDER BY Ord.EmployeeID

-- SELECT to fill the output parameter with the
-- maximum quantity from Order Details.
SELECT @MaxQuantity = MAX(Quantity) FROM [Order Details]

-- Return the number of all items ordered.
RETURN (SELECT SUM(Quantity) FROM [Order Details])
GO

-- Test the stored procedure.

-- DECLARE variables to hold the return code
-- and output parameter.
DECLARE @OrderSum INT
DECLARE @LargestOrder INT

-- Execute the procedure, which returns
-- the result set from the first SELECT.
EXEC @OrderSum = OrderSummary @MaxQuantity = @LargestOrder OUTPUT

-- Use the return code and output parameter.
PRINT 'The size of the largest single order was: ' +
CONVERT(CHAR(6), @LargestOrder)
PRINT 'The sum of the quantities ordered was: ' +
CONVERT(CHAR(6), @OrderSum)
GO
The output from running this sample is:

EmployeeID SummSales
----------- --------------------------
1 202,143.71
2 177,749.26
3 213,051.30
4 250,187.45
5 75,567.75
6 78,198.10
7 141,295.99
8 133,301.03
9 82,964.00
The size of the largest single order was: 130
The sum of the quantities ordered was: 51317
See Also

Stored Procedures


برگرفته از http://msdn.microsoft.com/en-us/library/aa174792(v=sql.80).aspx

شاد باشید.

boysilent
یک شنبه 25 دی 1390, 17:43 عصر
دوستان یه کد پیداکردم ببینید اصلا کاستومینگ پیج هست؟


البته فقط صفحه اول رو نشون میده صفحه دوم که میری دوباره همون صفحه رو نشون میده و لینکاش شماره صفحش پاک میشه؟





public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
}

protected void GridView1_DataBound(object sender, EventArgs e)
{
SetPaging();
}
private void SetPaging()
{
GridViewRow row = GridView1.BottomPagerRow;
int alphaStart = 65;

for (int i = 1; i < GridView1.PageCount; i++)
{
LinkButton btn = new LinkButton();
btn.CommandName = "Page";
btn.CommandArgument = i.ToString();

if (i == GridView1.PageIndex + 1)
{
رنگ باتن روباید عوضض کرد
}

btn.Text = Convert.ToChar(alphaStart).ToString();
btn.ToolTip = "Page " + i.ToString();
alphaStart++;
PlaceHolder place = row.FindControl("PlaceHolder1") as PlaceHolder;
place.Controls.Add(btn);

Label lbl = new Label();
lbl.Text = " ";
place.Controls.Add(lbl);
}
}
}

crazy_1892
یک شنبه 25 دی 1390, 17:56 عصر
دوست عزیز سورس یک وب سایت قرار دادم که page بندی repeater درونش قرار داره

http://barnamenevis.org/showthread.php?323335-%D9%BE%D8%B1%D9%88%DA%98%D9%87-open-Source-%D9%88%D8%A8-%D8%B3%D8%A7%DB%8C%D8%AA-%D8%A8%D8%B1%D8%A7%DB%8C-%D8%A7%D8%B3%D8%A7%D8%AA%DB%8C%D8%AF

boysilent
یک شنبه 25 دی 1390, 19:33 عصر
برادران عزیز کسی جوابی نداره؟

abbas3zaar
شنبه 02 اردیبهشت 1391, 00:37 صبح
من از دیتا سورس اثتفاده کردم این خیلی مفهئمش سنگینه برای من اماتور؟اینطور نیست/

اقا فایل پروژمو ذخیره کردم ببین دادا خودت/شرمنده دیگه

boysilent (http://barnamenevis.org/member.php?194851-boysilent) عزیز میشه دیتابیس این پروژه که زحمتشو کشیدی برام بزاری؟ ممنون میشم