Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to print * for my hotels rank in a label
is it possible ?
if no what should i do?
test2.rank is the variable that i got from db.

What I have tried:

C#
label1.text = for(int i=1;i<=test2.rank){ + "<img src='  '/>" + ;};
Posted
Updated 10-Jul-16 17:47pm
v3

1 solution

Quote:
Is it possible to write a loop in a label?
Not that way.
But this way.
C#
string tmp= "";
for(int i=1; i<=test2.rank; i++){
    tmp= tmp + "<img src=" " />";
}
label1.text = tmp; 
 
Share this answer
 
v2
Comments
saeed rajabi 10-Jul-16 23:24pm    
tnx
PIEBALDconsult 10-Jul-16 23:37pm    
Or with a StingBuilder rather than String concatenation.
Patrice T 10-Jul-16 23:47pm    
Sure

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900