Click here to Skip to main content
15,179,246 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Defaulting a DataView control with paging to the last page. Pin
ASHISH GHADI18-Mar-10 23:08
MemberASHISH GHADI18-Mar-10 23:08 
Questionif statement in the html code in aspx page Pin
laziale16-Mar-10 6:39
Memberlaziale16-Mar-10 6:39 
AnswerRe: if statement in the html code in aspx page Pin
JHizzle16-Mar-10 6:41
MemberJHizzle16-Mar-10 6:41 
GeneralRe: if statement in the html code in aspx page Pin
laziale16-Mar-10 6:43
Memberlaziale16-Mar-10 6:43 
GeneralRe: if statement in the html code in aspx page Pin
JHizzle16-Mar-10 6:50
MemberJHizzle16-Mar-10 6:50 
AnswerRe: if statement in the html code in aspx page Pin
Sandeep Mewara16-Mar-10 6:44
mveSandeep Mewara16-Mar-10 6:44 
GeneralRe: if statement in the html code in aspx page Pin
laziale16-Mar-10 6:50
Memberlaziale16-Mar-10 6:50 
AnswerRe: if statement in the html code in aspx page Pin
Sandeep Mewara16-Mar-10 6:51
mveSandeep Mewara16-Mar-10 6:51 
Based on what now you say, that this is not an independant label and is in the GridView template field...
Here you go:
void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{    
    if (e.Row.RowType == DataControlRowType.DataRow)    
    {           
         Label lblFirstName= (Label)e.Item.FindControl("lblFirstName");       
         if(lblFirstName.Text == "John")             
            lblFirstName.ForeColor=Color.Red;      
         else if(lblFirstName.Text == "Jim")
            lblFirstName.ForeColor= Color.Blue;
    }
}


Lastly, i would suggest to pick a book and read before mocing ahead with development. This is because 2-3 threads below you had been given almost 80% of the code and yet you are unable to get it.
GeneralRe: if statement in the html code in aspx page Pin
laziale16-Mar-10 7:03
Memberlaziale16-Mar-10 7:03 
AnswerRe: if statement in the html code in aspx page Pin
carlecomm16-Mar-10 18:30
Membercarlecomm16-Mar-10 18:30 
QuestionResponse.End() Pin
pss.srinivasan16-Mar-10 6:20
Memberpss.srinivasan16-Mar-10 6:20 
AnswerRe: Response.End() Pin
Sandeep Mewara16-Mar-10 6:38
mveSandeep Mewara16-Mar-10 6:38 
AnswerRe: Response.End() Pin
carlecomm17-Mar-10 16:17
Membercarlecomm17-Mar-10 16:17 
QuestionWeb User Controls(ascx) Pin
jonhbt16-Mar-10 5:47
Memberjonhbt16-Mar-10 5:47 
AnswerRe: Web User Controls(ascx) Pin
Sandeep Mewara16-Mar-10 5:58
mveSandeep Mewara16-Mar-10 5:58 
QuestionRe: Web User Controls(ascx) Pin
jonhbt16-Mar-10 6:11
Memberjonhbt16-Mar-10 6:11 
AnswerRe: Web User Controls(ascx) Pin
Sandeep Mewara16-Mar-10 6:40
mveSandeep Mewara16-Mar-10 6:40 
Questionprocedure or function expects parameter which was not supplied Pin
ishwarya mahadevan16-Mar-10 5:42
Memberishwarya mahadevan16-Mar-10 5:42 
AnswerRe: procedure or function expects parameter which was not supplied Pin
Sandeep Mewara16-Mar-10 5:55
mveSandeep Mewara16-Mar-10 5:55 
Questionhow to call gridview sort event explicitly? Pin
Tridip Bhattacharjee16-Mar-10 3:51
professionalTridip Bhattacharjee16-Mar-10 3:51 
AnswerRe: how to call gridview sort event explicitly? Pin
Neh.C16-Mar-10 4:15
MemberNeh.C16-Mar-10 4:15 
AnswerRe: how to call gridview sort event explicitly? Pin
Sandeep Mewara16-Mar-10 4:23
mveSandeep Mewara16-Mar-10 4:23 
Questionwhat is the difference between session and profile? Pin
Tridip Bhattacharjee16-Mar-10 3:51
professionalTridip Bhattacharjee16-Mar-10 3:51 
AnswerRe: what is the difference between session and profile? Pin
Sandeep Mewara16-Mar-10 4:15
mveSandeep Mewara16-Mar-10 4:15 
QuestionRe: ASP.NET Page refresh and result Pin
sowjanya315-Mar-10 23:15
Membersowjanya315-Mar-10 23:15 

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.