Hi
I try to dynamically build a div layout depending on the data i send to view, I want make 2 rows of divs and when there is odd number of models sent to view i want the layout to close.
As you can see in the code every 2nd model or on last model i close </div> and start <div> every odd model so i assume it't always opened and closed right amount of times .... but when i uncomment the commented code there are errors ....
(if i am not mistaken something similar worked in with C# so i hope it's only synax error)
I try to dynamically build a div layout depending on the data i send to view, I want make 2 rows of divs and when there is odd number of models sent to view i want the layout to close.
As you can see in the code every 2nd model or on last model i close </div> and start <div> every odd model so i assume it't always opened and closed right amount of times .... but when i uncomment the commented code there are errors ....
(if i am not mistaken something similar worked in with C# so i hope it's only synax error)
VB.NET:
@[COLOR=#00008B]For[/COLOR] [COLOR=#00008B]Each[/COLOR] procesData [COLOR=#00008B]In[/COLOR] Model
curElement = curElement + [COLOR=#800000]1[/COLOR]
elemNumb = elemNumb + [COLOR=#800000]1[/COLOR]
[COLOR=#00008B]If[/COLOR] (curElement = [COLOR=#800000]1[/COLOR]) [COLOR=#00008B]Then[/COLOR]
[COLOR=#808080]'@<div id="row"> !Comented[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
@<div id="row-element@elemNumb">
@<h3>Element number @elemNumb</h3>
@<h3>@procesData.Name</h3>
@<h3>@procesData.Status.ToString</h3>
@<br />
@</div>
[COLOR=#00008B]If[/COLOR] (curElement = Model.Count) [COLOR=#00008B]Then[/COLOR]
[COLOR=#00008B]If[/COLOR] (elemNumb = [COLOR=#800000]1[/COLOR]) [COLOR=#00008B]Then[/COLOR]
[COLOR=#808080]'@</div> !comented[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]If[/COLOR] (curElement = [COLOR=#800000]2[/COLOR]) [COLOR=#00008B]Then[/COLOR]
[COLOR=#808080]'@</div> !comented[/COLOR]
elemNumb = [COLOR=#800000]0[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]Next[/COLOR]