This is a discussion on Create control according to their data type within the .Net Development forums, part of the Programming & Scripting category; hi actually problem is with commented line.if i comment that line in that case no error.what i m missing? // ...
| |||||||
|
#21
| ||||
| ||||
| hi actually problem is with commented line.if i comment that line in that case no error.what i m missing? // objPds.CurrentPageIndex = CurrentPage - 1; Code: public partial class ConfigurationTool_EditPackage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!string.IsNullOrEmpty(Request.Form["MemberID"]))
//{
PackageList dd = PackageListBL.GetExtraInfo(121);
if (dd != null)
{
PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = dd;
objPds.AllowPaging = true;
objPds.PageSize = 5;
// objPds.CurrentPageIndex = CurrentPage - 1;
rptExtraInfo.DataSource = objPds;
rptExtraInfo.DataBind();
}
else
{
rptExtraInfo.DataBind();
}
}
//}
public int CurrentPage
{
get
{
// look for current page in ViewState
object o = this.ViewState["_CurrentPage"];
if (o == null)
return 0; // default page index of 0
else
return (int)o;
}
set
{
this.ViewState["_CurrentPage"] = value;
}
}
}
__________________ Love is physical attraction and mental destruction |
|
#22
| ||||
| ||||
| Perhaps your CurrentPage is finding nothing in ViewState and returning 0. Then the CurrentPageIndex would be set to 0 - 1 = -1 which would throw an error.
__________________ Join the folding team |
|
#23
| ||||
| ||||
| but i think ViewState["_CurrentPage"] is default page level property.so what to do for this? |
|
#24
| ||||
| ||||
| i think this Code: objPds.CurrentPageIndex = CurrentPage - 1; Code: objPds.CurrentPageIndex = CurrentPage; |
|
#25
| ||||
| ||||
| hi Thank u so much RR about your help so far.now my paging stuff with repeater is fine now problem is to retaim values of page. as your know at each page i have form control likes text box ,dropdown .so when user filled all these values at first page and after clicking next go to next page and filled data their also and agian back to previous page the data at this page being lost. how to retain these values. |
|
#27
| ||||
| ||||
| some sort of example would be appreciated about session. any other way if not willing to use session. |
|
#28
| ||||
| ||||
| To add items to a session variable, use something like:- Code: HttpContext.Current.Session.Contents.Add("varName",varValue)
Code: Dim myValue as String = HttpContext.Current.Session.Contents.Item("varName")
Maybe someone else might have a better solution... |
|
#29
| ||||
| ||||
| once data filling has done in pages then user will submit .after submit i will save that data into database. but problem is i m using paging so during page navigation i m not able to retain values. still i m not clear with your example of session?? |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create/Print Form data | Rebelle | ASP Development | 5 | December 10th, 2008 10:25 AM |
| Binding data to the RadioButtonList Control | Shem | .Net Development | 2 | December 3rd, 2008 02:42 AM |
| The data source 'ObjectDataSource1' does not support sorting with IEnumerable data | Shem | .Net Development | 5 | June 25th, 2008 08:07 AM |
| Data Type Mismatch in Criteria Expression | alansidman | Microsoft Access | 1 | April 9th, 2008 04:33 PM |
| [Error] Type mismatch: HTMLEncode | Rebelle | ASP Development | 20 | March 28th, 2008 09:30 AM |