Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
UI.WebPartName() method is returning a list<string>
e.g.
ABC
DEF
xyz

How can I set the values in, Zone1.WebParts[0].Title ?

Previous code as below:
C#
Zone1.WebParts[0].Title = webpartname.Tables[0].Rows[0][0].ToString();
Zone2.WebParts[0].Title = webpartname.Tables[0].Rows[1][0].ToString();
Zone3.WebParts[0].Title = webpartname.Tables[0].Rows[2][0].ToString();
Posted
Updated 31-Dec-13 20:27pm
v2

Use like this
C#
List<string> list = UI.WebPartName();
Zone1.WebParts[0].Title = list[0];
Zone2.WebParts[0].Title = list[1];
...
</string>
 
Share this answer
 
C#
Zone1.WebParts[0].Title = UI.WebPartName()[0];
 
Share this answer
 
You have to iterate/loop through the list, read this:
Example[^]
 
Share this answer
 
v3

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