Click here to Skip to main content
15,902,939 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionReturn Value from window.ShowModalDialog() [modified] Pin
Tom Lawrance18-Aug-06 1:00
professionalTom Lawrance18-Aug-06 1:00 
AnswerRe: Return Value from window.ShowModalDialog() Pin
Tom Lawrance18-Aug-06 1:53
professionalTom Lawrance18-Aug-06 1:53 
QuestionForms Authentication Question Pin
matthias s.18-Aug-06 0:41
matthias s.18-Aug-06 0:41 
AnswerRe: Forms Authentication Question Pin
minhpc_bk18-Aug-06 12:21
minhpc_bk18-Aug-06 12:21 
GeneralRe: Forms Authentication Question Pin
matthias s.22-Aug-06 21:17
matthias s.22-Aug-06 21:17 
QuestionASP.NET caching in NLB scenario Pin
K.P.Kannan18-Aug-06 0:39
K.P.Kannan18-Aug-06 0:39 
AnswerRe: ASP.NET caching in NLB scenario Pin
minhpc_bk18-Aug-06 12:23
minhpc_bk18-Aug-06 12:23 
QuestionError Occurs while Paging in Datagrid!....... Pin
Prabs frm PGP18-Aug-06 0:05
Prabs frm PGP18-Aug-06 0:05 
Hi I want to do paging in the datalist.

For that i wrote the code:

public int intStart=0;

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
ViewState ["Start"]= 0;
list();
}
}



public void list()
{
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter("select name from sampledatagrid",conn);
DataSet ds1 = new DataSet();
intStart = (int) ViewState["Start"];
ViewState ["PageSize"]=7;
sda.Fill(ds1,intStart,(int)ViewState["PageSize"],"sampledatagrid");
dlistSample.DataSource=ds1.Tables[0].DefaultView;
dlistSample.DataBind();
conn.Close();
}


private void lnkPrevious_Click(object sender, System.EventArgs e)
{
intStart = (int) ViewState["Start"] -(int) ViewState["pageSize"];
ViewState["Start"] = intStart;
if (intStart <= 0 )
{
ViewState["Start"] = 0;
}
list();
}


private void lnkNext_Click(object sender, System.EventArgs e)
{
int dlistcount = dlistSample.Items.Count;
intStart = (int)ViewState["Start"] + (int)ViewState["pageSize"];
ViewState["Start"] = intStart;
if ( dlistcount < (int)ViewState["pageSize"] )
{
ViewState["Start"] = (int)ViewState["Start"] - (int)ViewState["pageSize"];
}
list();
}
}





Here the values are displayed correctly in the Datalist., But If i cliks the Next or previus linkbutton(<< or >>) at the time it shows the error:


Object reference not set to an instance of an object.

Error occured in this line:

intStart = (int)ViewState["Start"] + (int)ViewState["pageSize"];

How can we solve this one?



Prabu.T
AnswerRe: Error Occurs while Paging in Datagrid!....... Pin
Vipin Venugopal18-Aug-06 0:46
Vipin Venugopal18-Aug-06 0:46 
QuestionTree view Pin
BharadwajN17-Aug-06 23:51
BharadwajN17-Aug-06 23:51 
AnswerRe: Tree view Pin
coolestCoder18-Aug-06 0:33
coolestCoder18-Aug-06 0:33 
QuestionHow to get the radio button list's selected value at client side? Pin
SIJUTHOMASP17-Aug-06 23:26
professionalSIJUTHOMASP17-Aug-06 23:26 
AnswerRe: How to get the radio button list's selected value at client side? Pin
_AK_18-Aug-06 0:23
_AK_18-Aug-06 0:23 
GeneralRe: How to get the radio button list's selected value at client side? Pin
SIJUTHOMASP18-Aug-06 2:17
professionalSIJUTHOMASP18-Aug-06 2:17 
QuestionEventHandler firing without an event being called.. Pin
Sivaprasad C17-Aug-06 23:22
Sivaprasad C17-Aug-06 23:22 
GeneralRe: EventHandler firing without an event being called. Pin
_AK_18-Aug-06 0:15
_AK_18-Aug-06 0:15 
GeneralRe: EventHandler firing without an event being called. Pin
Sivaprasad C18-Aug-06 0:41
Sivaprasad C18-Aug-06 0:41 
AnswerRe: EventHandler firing without an event being called.. Pin
K.P.Kannan18-Aug-06 0:46
K.P.Kannan18-Aug-06 0:46 
GeneralRe: EventHandler firing without an event being called.. Pin
Sivaprasad C18-Aug-06 0:57
Sivaprasad C18-Aug-06 0:57 
AnswerRe: EventHandler firing without an event being called.. Pin
eggsovereasy18-Aug-06 3:37
eggsovereasy18-Aug-06 3:37 
QuestionHow to refer the controls of a webuser control?? Pin
kvPriya17-Aug-06 23:08
kvPriya17-Aug-06 23:08 
AnswerRe: How to refer the controls of a webuser control?? Pin
Sivaprasad C17-Aug-06 23:13
Sivaprasad C17-Aug-06 23:13 
GeneralBut, I have to refer the control in some other .aspx page Pin
kvPriya18-Aug-06 1:37
kvPriya18-Aug-06 1:37 
AnswerRe: How to refer the controls of a webuser control?? Pin
_AK_18-Aug-06 0:25
_AK_18-Aug-06 0:25 
GeneralRe: How to refer the controls of a webuser control?? Pin
kvPriya18-Aug-06 0:59
kvPriya18-Aug-06 0:59 

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.