Ajax.ActionLink에서 htmlAttributes를 사용할 때 부정확 한 쿼리를 렌더링하는 데 문제가 있다는 것을 아는 사람이 있습니까? htmlAttributes에 빈 배열을 넣어도 링크가 잘못 렌더링되는 것 같습니다. 여기 내 코드가있다.htmlAttributes를 사용할 때 Ajax.ActionLink가 링크를 잘못 렌더링하는 문제가 발생했습니다.
나는이 작업을 수행 할 때 (새로운 {}주의) :
<%= Ajax.ActionLink("Delete", "Delete", "Milestone", new RouteValueDictionary { { "id", Model.Id } }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ModalDeleteContainer", OnSuccess = "modalDelete" }, new { })%>
링크는 다음과 같이 렌더링 :
<a href="/Client/1/Admin/Milestone/Delete?Count=1&Keys=System.Collections.Generic.Dictionary%602%2BKeyCollection%5BSystem.String%2CSystem.Object%5D&Values=System.Collections.Generic.Dictionary%602%2BValueCollection%5BSystem.String%2CSystem.Object%5D" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'GET', updateTargetId: 'ModalDeleteContainer', onSuccess: Function.createDelegate(this, modalDelete) });">Delete</a>
나는이 할 때 (대신 null의 새로운 {}) :
를<%= Ajax.ActionLink("Delete", "Delete", "Milestone", new RouteValueDictionary { { "id", Model.Id } }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ModalDeleteContainer", OnSuccess = "modalDelete" }, null)%>
링크는 다음과 같이 렌더링 :
<a href="/Client/1/Admin/Milestone/Delete/703c749e-c145-4cf1-90eb-9bee00bac79d" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'GET', updateTargetId: 'ModalDeleteContainer', onSuccess: Function.createDelegate(this, modalDelete) });">Delete</a>
두 가지의 유일한 차이점은 Ajax.ActionLink의 끝에있는 htmlAttributes 인수입니다. 어떤 통찰력을 가져 주셔서 감사합니다!
굉장하다. 감사! –