devforall
devforall

Reputation: 7337

Form Collection item coming up as null

I am trying to use form collection and this is what i am using to submit the form.

 <%=Html.ActionLink("Update", "Calendar", ViewData["sub"], new { onclick =  "this.form.submit();" })%>

Just for the heck of it i tried replacing it with a dropdownlist that retains its value and all of a sudden i get all my form collection.

 <%=Html.DropDownList("dllMonth", new SelectList(new List<string>() { "January", 
    "Feburary", "March", "April", "June", "July", "August", "September", "October", "November", "December"}, ViewData["Month"]), new { onchange = "this.form.submit();" })%>

Can someone please explain whats going on?

Upvotes: 0

Views: 1262

Answers (1)

devforall
devforall

Reputation: 7337

I changed my action link to the following and now all is working fine:

<a name="update" href="Calendar" onclick="this.form.submit();" type="submit">Update</a> 

Upvotes: 1

Related Questions