Click here to Skip to main content
15,886,362 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: ASP.NET Deployment, how Pin
awedaonline24-Jan-10 22:25
awedaonline24-Jan-10 22:25 
QuestionMessage Removed Pin
23-Jan-10 1:12
hi_everybody23-Jan-10 1:12 
AnswerRe: how can i handle url Pin
Not Active23-Jan-10 2:28
mentorNot Active23-Jan-10 2:28 
GeneralMessage Removed Pin
24-Jan-10 19:59
hi_everybody24-Jan-10 19:59 
GeneralRe: how can i handle url Pin
Not Active25-Jan-10 1:05
mentorNot Active25-Jan-10 1:05 
QuestionCounting the values in a gridview Pin
AndyASPVB22-Jan-10 23:30
AndyASPVB22-Jan-10 23:30 
AnswerRe: Counting the values in a gridview Pin
Manas Bhardwaj23-Jan-10 1:12
professionalManas Bhardwaj23-Jan-10 1:12 
GeneralRe: Counting the values in a gridview Pin
AndyASPVB23-Jan-10 1:21
AndyASPVB23-Jan-10 1:21 
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

{

Table tbl = e.Row.Parent as Table;

TableCell cell = new TableCell();

CheckBox chk = new CheckBox();

Label lbl2 = new Label();

HiddenField rowValue = new HiddenField();

if (e.Row.RowType == DataControlRowType.Header)

{

e.Row.Visible = false;

}

else

{

if (e.Row.RowType == DataControlRowType.DataRow)

{

Label lbl = (Label)e.Row.FindControl("lblValue");

string str1 = ((Label)(lbl)).Text;

string prevStr= (string)Session["previousStr"];

if (prevStr== str1)

{

counter += 1;

}

else

{

prevStr= sr1 ;

Session["previousStr"] = prevStr;

counter = 1;



if (tbl != null)

{

GridViewRow row = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal);



rowValue.ID = "hdnNumRows";

rowValue.Value = counter;

lbl2.Text = Convert.ToString(counter);

cell.ColumnSpan = this.GridView1.Columns.Count;

cell.Width = Unit.Percentage(100);

cell.BackColor = System.Drawing.Color.Aqua;

HtmlGenericControl span = new HtmlGenericControl("span");

span.InnerHtml = prevStr;

cell.Controls.Add(span);

cell.Controls.Add(chk);

cell.Controls.Add(lbl2);

cell.Controls.Add(rowValue);

row.Cells.Add(cell);

tbl.Rows.AddAt(tbl.Rows.Count - 1, row);





}

}









}



}



}


As you can see, I have a counter in both parts of my if statement. This is so that if the "if" part is true the counter goes up by one, else it is still one. When run this with JavaScript to show the results, it is fine, I am seeing 3, 2, 1, but when I try show this in a label, all I am seeing 1,1,1. Why?
GeneralRe: Counting the values in a gridview Pin
Manas Bhardwaj23-Jan-10 1:34
professionalManas Bhardwaj23-Jan-10 1:34 
GeneralRe: Counting the values in a gridview Pin
AndyASPVB23-Jan-10 1:45
AndyASPVB23-Jan-10 1:45 
Questionbrowser issues Pin
saravanan0522-Jan-10 20:08
saravanan0522-Jan-10 20:08 
AnswerRe: browser issues Pin
Manas Bhardwaj23-Jan-10 1:18
professionalManas Bhardwaj23-Jan-10 1:18 
AnswerRe: browser issues Pin
April Fans25-Jan-10 0:52
April Fans25-Jan-10 0:52 
Questionused iframe in my webpage want to get url of the ifram , refresh the iframe, full screen the iframe using the buttons of the web page Pin
praveenkumar_vittaboina22-Jan-10 19:32
praveenkumar_vittaboina22-Jan-10 19:32 
QuestionListbox SelectedIndex changed and click event Pin
sjs4u22-Jan-10 18:56
sjs4u22-Jan-10 18:56 
AnswerRe: Listbox SelectedIndex changed and click event Pin
Not Active23-Jan-10 2:21
mentorNot Active23-Jan-10 2:21 
QuestionPop up or model dialgue for aspx page Pin
indian14322-Jan-10 8:13
indian14322-Jan-10 8:13 
AnswerRe: Pop up or model dialgue for aspx page Pin
Not Active22-Jan-10 11:09
mentorNot Active22-Jan-10 11:09 
QuestionHTML table in Ajax tab control Pin
Rock Star.22-Jan-10 4:24
Rock Star.22-Jan-10 4:24 
QuestionCrystal Report Direct Print Pin
Girish_Sharma22-Jan-10 1:29
Girish_Sharma22-Jan-10 1:29 
AnswerRe: Crystal Report Direct Print Pin
thatraja22-Jan-10 2:12
professionalthatraja22-Jan-10 2:12 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma22-Jan-10 2:27
Girish_Sharma22-Jan-10 2:27 
GeneralRe: Crystal Report Direct Print Pin
thatraja22-Jan-10 2:39
professionalthatraja22-Jan-10 2:39 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma23-Jan-10 1:06
Girish_Sharma23-Jan-10 1:06 
GeneralRe: Crystal Report Direct Print Pin
thatraja23-Jan-10 6:43
professionalthatraja23-Jan-10 6:43 

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.