regardsing string in asp.net c#.. [Resolved]

Posted by Gopal_nivas under ASP.NET on 9/23/2010 | Points: 10 | Views : 1068 | Status : [Member] | Replies : 4
hi i have a string like "ram,raj,john upto n values"..


i want show like this
ram,
raj,
john,
.
.
upto n

the details are came from database..

i am using this code
string s = DS.Tables[0].Rows[0]["desc"].ToString();
lbl_productdetails.Text= s.Replace(",", ",\n");
if i put breakpoint and chect tat line means the details are come in next line..

but in page it displays the information in single row..
i want to display this in label control..
how to handle this..

need ur suggetsions..

regards
gopal.s




Responses

Posted by: Peermohamedmydeen on: 9/23/2010 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Hi,
Have you tried with "</br> " instead of "\n "?

Try the below Line.

lbl_productdetails.Text= s.Replace(",", ",</br>"); 


Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 9/23/2010 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Peermohamedmydeen is correct, however, keep "<br />" not "</br>". I know its typo from Peermohamedmydeen.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Peermohamedmydeen on: 9/23/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi SheoNarayan,

Its my typo only.

But, I have checked with </br>. I think </br> works well.


Kindly check.



Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 9/23/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
@Peermohamedmydeen,

</br> may work but syntactically its wrong and may not work in all the browsers :)

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response