Click here to Skip to main content
15,894,460 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionGridview Questions Pin
kallileo3-May-07 23:40
kallileo3-May-07 23:40 
AnswerRe: Gridview Questions Pin
Spunky Coder4-May-07 0:18
Spunky Coder4-May-07 0:18 
AnswerRe: Gridview Questions Pin
Chetan Ranpariya4-May-07 0:27
Chetan Ranpariya4-May-07 0:27 
GeneralRe: Gridview Questions Pin
kallileo4-May-07 1:20
kallileo4-May-07 1:20 
Questiondatalist control and navigation panel Pin
tradakad3-May-07 22:22
tradakad3-May-07 22:22 
AnswerRe: datalist control and navigation panel Pin
Spunky Coder3-May-07 22:30
Spunky Coder3-May-07 22:30 
GeneralRe: datalist control and navigation panel Pin
tradakad3-May-07 22:46
tradakad3-May-07 22:46 
GeneralRe: datalist control and navigation panel Pin
Spunky Coder3-May-07 22:57
Spunky Coder3-May-07 22:57 
Hey for eg:You have got a table(say 'dt') retrieved from the database...
Now bind it to PagedDataSource.

public partial class Default4 : System.Web.UI.Page <br />
<br />
{<br />
  <br />
    <br />
    DataTable dt = null;<br />
    protected int currentpage = 0;<br />
<br />
    protected void Page_Load(object sender, EventArgs e)<br />
<br />
    {<br />
   //Place Your code of retreiving the data from the database here.<br />
<br />
        #region Datalist binding with PagedDataSource<br />
<br />
<br />
        PagedDataSource ps = new PagedDataSource();<br />
        ps.DataSource = dt.DefaultView;<br />
        ps.AllowPaging = true;<br />
        <br />
        ps.PageSize = 2;<br />
<br />
        if (Request.QueryString["Page"] != null)<br />
        {<br />
            currentpage = Convert.ToInt32(Request.QueryString["Page"]);<br />
<br />
        }<br />
        else<br />
        {<br />
            currentpage = 1;<br />
        }<br />
<br />
        ps.CurrentPageIndex = currentpage - 1;<br />
        Label1.Text = "Page:" + currentpage;<br />
<br />
         if(!ps.IsFirstPage)<br />
        {<br />
        PrevLink.NavigateUrl = Request.CurrentExecutionFilePath +"?Page=" +(currentpage - 1);<br />
        }<br />
<br />
    if (!ps.IsLastPage)<br />
        {<br />
        NextLink.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" +(currentpage + 1);<br />
        }<br />
    <br />
<br />
<br />
<br />
        DataList1.DataSource = ps;<br />
        DataList1.DataBind();<br />
<br />
<br />
        #endregion<br />
<br />
<br />
    }



In the above example prevlink and nextLink are the Hyperlinks in your page


Koushik

GeneralRe: datalist control and navigation panel Pin
tradakad4-May-07 7:43
tradakad4-May-07 7:43 
Questionhow to transfer data between pages with Hyperlink ? Pin
hdv2123-May-07 22:18
hdv2123-May-07 22:18 
AnswerRe: how to transfer data between pages with Hyperlink ? Pin
Chetan Ranpariya3-May-07 22:28
Chetan Ranpariya3-May-07 22:28 
AnswerRe: how to transfer data between pages with Hyperlink ? Pin
Arun.Immanuel3-May-07 22:30
Arun.Immanuel3-May-07 22:30 
GeneralRe: how to transfer data between pages with Hyperlink ? Pin
hdv2124-May-07 0:03
hdv2124-May-07 0:03 
GeneralRe: how to transfer data between pages with Hyperlink ? Pin
Arun.Immanuel4-May-07 1:05
Arun.Immanuel4-May-07 1:05 
Questionusing difference between the two methods in code-behind Pin
surya3kiran3-May-07 22:00
surya3kiran3-May-07 22:00 
AnswerRe: using difference between the two methods in code-behind Pin
Sandeep Akhare3-May-07 22:15
Sandeep Akhare3-May-07 22:15 
Questiondoubt about ds.Tables[0].DefaultView Pin
saravanan053-May-07 21:45
saravanan053-May-07 21:45 
AnswerRe: doubt about ds.Tables[0].DefaultView Pin
Spunky Coder3-May-07 22:40
Spunky Coder3-May-07 22:40 
AnswerRe: doubt about ds.Tables[0].DefaultView Pin
rujuc#3-May-07 22:46
rujuc#3-May-07 22:46 
Questionjavascript visiblity and hidden Pin
yesu prakash3-May-07 21:23
yesu prakash3-May-07 21:23 
AnswerRe: javascript visiblity and hidden Pin
Sandeep Akhare3-May-07 21:32
Sandeep Akhare3-May-07 21:32 
AnswerRe: javascript visiblity and hidden Pin
Sandeep Kumar3-May-07 22:21
Sandeep Kumar3-May-07 22:21 
Questiononline exam Pin
yesu prakash3-May-07 20:45
yesu prakash3-May-07 20:45 
AnswerRe: online exam Pin
rujuc#3-May-07 20:57
rujuc#3-May-07 20:57 
QuestionRemember Username and Password Pin
Socheat.Net3-May-07 20:42
Socheat.Net3-May-07 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.