   [.net] Datagrid paging (webforms) without javascript?
  Simple question:How to make datagrid paging work without &#106avascript? I have a simple datagrid, which gets populated by a dataview, it works perfectly, paging works too, but, as I said, it does only with &#106avascript. I know how to set the index of the grid etc. My Idea would be using my own links (with query-parameters attached on them, the parameter would transport the position of the targeted page in the grid) I just need basicaly a method with what I can change the links the grid does create on the on the back and forwards buttons.The grid uses links like those as back and forward links:<a href="javascript:__doPostBack('ctl00$DataGrid1$ctl14$ctl01','')" style="color:#[000066];">[2]</a>How can I overwrite them?   
  Here's what I did to get paging to work without &#106avascript.  I used C# instead.private void dgAdvanced_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e){dgAdvanced.CurrentPageIndex = e.NewPageIndex;BindGrid(GetResults(GetColumns(), GetConditions()));}Essentially, I just run the query that was used to attain the data for the DataGrid again.  I setup the properties for the DataGrid to display so many results at once.  Whenever a person changed moves ahead, or back inthe data, the index changes, the query is run again, and the result are displayed, starting from that index.  The BindGrid Procedure is just what i use to run the query again.  Whatever you use to get that information is up to you.   ;  That has nothing to do with my question. I mean that the datagrid generates &#106avascript links (if paging works and is active) on the back and forward buttons/links (or numeric buttons/links).I want to overwrite those with links of such kind:DatagridPage.aspx?DatagridPaging=[Insert the paging index number here]   ;  this particular article should put you in the right direction.  This particular section of the source seems to be what you need.public static string CreatePagerLinks(PagedDataSource objPds, string BaseUrl){StringBuilder sbPager = new StringBuilder();sbPager.Append("More: ");if (!objPds.IsFirstPage){// first page linksbPager.Append("<a href=\"");sbPager.Append(BaseUrl);sbPager.Append("\">|<</a> ");if (objPds.CurrentPageIndex != 1){// previous page linksbPager.Append("<a href=\"");sbPager.Append(BaseUrl);sbPager.Append("&page=");sbPager.Append(objPds.CurrentPageIndex.ToString());sbPager.Append("\" alt=\"Previous Page\"><<</a>  ");}}// calc low and high limits for numeric linksint intLow = objPds.CurrentPageIndex - 1;int intHigh = objPds.CurrentPageIndex + 3;if (intLow < 1) intLow = 1;if (intHigh > objPds.PageCount) intHigh = objPds.PageCount;if (intHigh - intLow < 5) while ((intHigh < intLow + 4) && intHigh < objPds.PageCount) intHigh++;if (intHigh - intLow < 5) while ((intLow > intHigh - 4) && intLow > 1) intLow--;for (int x = intLow; x < intHigh + 1; x++){// numeric linksif (x == objPds.CurrentPageIndex + 1) sbPager.Append(x.ToString() + "  ");else{sbPager.Append("<a href=\"");sbPager.Append(BaseUrl);sbPager.Append("&page=");sbPager.Append(x.ToString());sbPager.Append("\">");sbPager.Append(x.ToString());sbPager.Append("</a>  " );}}if (!objPds.IsLastPage){if ((objPds.CurrentPageIndex + 2) != objPds.PageCount){// next page linksbPager.Append("<a href=\"");sbPager.Append(BaseUrl);sbPager.Append("&page=");sbPager.Append(Convert.ToString(objPds.CurrentPageIndex + 2));sbPager.Append("\">>></a>  ");}// last page linksbPager.Append("<a href=\"");sbPager.Append(BaseUrl);sbPager.Append("&page=");sbPager.Append(objPds.PageCount.ToString());sbPager.Append("\">>|</a>");}// conver the final links to a string and assign to labelsreturn sbPager.ToString();}The article speaks of a PagedDataSource object.  I've never used one before, but it seems to be the way you need to go.   ;  Seems to be it, thanks.   