Why doesn't the Save button in StoreManager/Edit.aspx work?

Sep 30, 2010 at 3:47 PM
Edited Sep 30, 2010 at 3:50 PM

As per the tutorial, when I created the Edit.aspx page (pg. 52) and insert the "Html.EditorFor(...)" code in the final rendition, I end up with 2 SAVE buttons, one from the page and other from the Album.ascx. The SAVE in Album.ascx submits the page properly, while the SAVE in Edit.ascx doesn't. I understand (using ASP.NET knowledge) why the first SAVE works. But I can't understand why the second SAVE doesn't event fire (I tried debugging via a break point).

- Tushar G. Walavalkar

Sep 30, 2010 at 4:17 PM
Edited Sep 30, 2010 at 4:24 PM

I checked out the "View Source" of the resulting page and found the answer. This code resulted in the Album <FORM> nested inside Edit <FORM>. That is bad HTML 4.01 because nested forms aren't permitted. Controls after the </FORM> tag do not participate in form submission. Hence the Edit SAVE didn't work. I

So I got rid of Album's FORM and VALIDATIONSUMMARY and the SAVE button. Now the page is HTML compliant and works as well.

- Tushar G. Walavalkar

Coordinator
Oct 1, 2010 at 12:07 AM

Tushar - Yes, that's correct. You'll see that over the following two pages we customize the editor template and remove that additional form. We used the Edit view template to generate the fields for us, but need to remove the nested form. See the code on page 53 - 54 to see the end result.