Hi, I am using several forms of start. I'm not sure this is a good idea. This is my code.<% using (Html.BeginForm("TagManagement", "InternalTag",FormMethod.Post))
{%>
<%: Html.AntiForgeryToken() %>
<table>
<tr>
<td><%:Html.Label("Type") %></td>
<td style="text-align:left"><%:Html.DropDownList("ObjectType",ViewData["TagObjects"] as IEnumerable<SelectListItem>)%></td>
</tr>
<tr>
<td><%:Html.Label("Search ID")%></td>
<td style="text-align:left"><%:Html.TextBox("ObjectID2")%></td>
</tr>
<tr>
<td></td>
<td><input id="Search" type="submit" value="Search" /> <input id="Create" type="button" value="Add to New Tag" onclick="AddTagElements()" /></td>
</tr>
</table>
<br />
<% } %>
<% using (Html.BeginForm("CreateTag","InternalTag",FormMethod.Post)) { %>
<%: Html.AntiForgeryToken() %>
<div id="AddTag">
<input id='SaveTag' type='submit' value='Save' style='width: 125px' />
</div>
<% } %>
routing code
"Tags/{controller}/{action}/{id}/{type}",
new { action = "Index", id = UrlParameter.Optional, type = UrlParameter.Optional }
my controller methods:
public ActionResult TagManagement(FormCollection FC,Guid? ID,InternalTagRef_Types? Type)
public ActionResult CreateTag(FormCollection FC, Guid ID, InternalTagRef_Types Type)
when i click on search. TagManagement Actions parameters are populated correctly. When I click on SaveTag, it tries to call the CreateTag action, but cannot, because the identifier and type are missing. I get an error. The parameter dictionary contains a null entry for the "ID" parameter of a non-nullable type of "System.Guid". It should get these values ββfrom the URL, i.e.
http: // localhost: 1338 / Tags / InternalTag / TagManagement / D104EBF5-470B-4FAA-9FC7-5391922CCE94 / Projects , like TagManagement. Please, help.
David