adding <fieldset> groupings

Jan 29, 2013 at 4:12 PM

hi,

I would like to add <fieldset> functionality, but am not sure what the best approach is.

 

I have a View which instead of calling Form.RenderHtml(), it has a for loop, and for each control on the Form, calls RenderHtml() on the control. This produces nearly the same result as Form.RenderHtml() (I do lose ViewState but use TempData instead) but gives me controls of styles on each individual control. It didn't seem appropriate to put styles inside the Model.

Anyway, I would like to be able to put one or more fieldsets to wrap my controls around. I can either put this in the View, or have this live at the Form level. I'm not sure what is the best design / flexible approach here. If i put it in the Form, it gets more re-usable. But if I put it in View, it gives the View more control of how the controls should look & be laid out... What do you think?

 

Drew

Jan 29, 2013 at 6:59 PM
Edited Jan 29, 2013 at 7:04 PM

I just looked through the latest version in the Forks section, and I see you have added these concepts already using some Template stuff where you string.Replace the HTML content into a template using GUIDs..

This is very clever... thanks a lot! FYI, the 'TEST' sample crashes when looking for the 'description' control because it was commented out. I added it back in and now the Test runs great, although the Date control isn't showing up at the bottom. Have to figure out why and figure out how this code is working in general.

I don't know why there's no download for this latest version. On the 2.0 site, there's no download at all. There's only a download for version 1.0 - this is why I had the old version. I had to sort through the versions and find the latest in the forks section to get this. I am new to codeplex, so forgive my ignorance if I'm missing something...

 

thanks again !

 

Drew

Coordinator
Jan 29, 2013 at 11:39 PM

I'm glad you got it worked out.