Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Data paging with a data table -


i've got datatable stores number of records. there column called id autoincrememted seed of 1.

i have implemented paging control. know id of first , last record need display, don't know how extract specific rows datatable, or whether indeed possible. possible, or need use dataset example?

im using cms product called sitefinity, dont have access db use sqldataadapter or similar,

this might not elegant solution might work you. i'm assuming you'll able figure out start index , next index based on code below.

datatable dt = gettable(); // represents datatable coming datatable temp = dt.clone(); datarow[] rows = dt.select("id >= 1"); //insert next begining index  int pagesize = 5; int ctr = 0; foreach(var row in rows) {     datarow r = temp.newrow();      r["id"] = row["id"];      r["name"] = row["name"];     temp.rows.add(r); //its neccesary create new datarow or you'll exception if u add row belonging datatable    ctr++;    if(ctr == pagesize) break; }  //at point temp hold either 0 rows or <= pagesize rows , can bind control it. 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -