Hi
I have below code & i want green background & white foreground
Code
StudentName += objResult.Name + "" + "," + " ";Thanks
Hi
I have below code & i want green background & white foreground
StudentName += objResult.Name + "" + "," + " ";Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 30, 2023, 2:50 AM EDT
Try this one,
Add Css class in you stylesheet
.bgfgColor { background-color: #2B800B; color : #FFFFFF }add classname in your cshtml
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 30, 2023, 2:01 AM EDT
Hello Ramco,
where you are displaying this value in UI ?
Ramco RamcoRank #462 · 5.4K reputationPosted Mar 30, 2023, 2:41 AM EDT
Hi
in code behind
htmlTable.Append("
Thanks
Amit MohantyRank #112 · 20K reputationPosted Mar 30, 2023, 3:01 AM EDT
You can add css to your stylesheet as per Jignesh or you can use like this:
htmlTable.Append("" + StudentName + "");Ramco RamcoRank #462 · 5.4K reputationPosted Mar 30, 2023, 3:39 AM EDT
Hi Jignesh
Actual code is below . I want each name background color = Green & Foreground white. In single td there r multiple students.
I want color for each student in single td only.
foreach (var colum1 in objStudentList) { StudentDetail objResult = bALStudents.GetStudentDetailByLoginID(Convert.ToInt32(colum1.StudentID)); StudentName += objResult.Name + "" + "," + " "; } htmlTable.Append("" + StudentName + "");Below is the aspx
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Mar 30, 2023, 3:43 AM EDT
Hi Amit
Actually in 1 td there r multiple student names.
I want color for each .
Thanks