Kiko polaeka, lugeto praznici teraat
zatoa ne ti odgovorile,...
Eve ti VB.NET
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim myConnection As New _
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim myDA As New SqlClient.SqlDataAdapter("Select * from dtsDefect", _
myConnection)
myDA.Fill(ds, "t1")
pageds.DataSource = ds.Tables("t1").DefaultView
pageds.AllowPaging = True
pageds.PageSize = 4
Dim curpage As Integer
If Not IsNothing(Request.QueryString("Page")) Then
curpage = Convert.ToInt32(Request.QueryString("Page"))
Else
curpage = 1
End If
pageds.CurrentPageIndex = curpage - 1
lblCurrpage.Text = "Page: " + curpage.ToString()
If Not pageds.IsFirstPage Then
lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + _
"?Page=" + CStr(curpage - 1)
End If
If Not pageds.IsLastPage Then
lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + _
"?Page=" + CStr(curpage + 1)
End If
DataList1.DataSource = pageds
DataList1.DataBind()
End Sub A u C# lesno ke si ja prevedish...
Kiko напиша:
Изгледа немало програмери на форумов...