【发布时间】:2014-08-13 14:34:03
【问题描述】:
我有以下情况:我正在开发一个使用 jQuery Mobile 视图的 C#/.NET Web 应用程序。
我的视图显示以下 ListView:
<ul data-role="listview" data-inset="true" data-theme="b" data-split-icon="delete">
@foreach (DataModel.Vulnerability.OVAL item in Model.VulnerabilityOVALs)
{
<li><a href="@Url.Action("Details", "Product", new { Title = item.Title })">
<h2>@item.Title</h2>
<table style="width: 100%">
<tr>
<th>Id</th>
<th>Definition ID</th>
<th>Title</th>
<th>URL</th>
<th>Status</th>
<th>Reference ID</th>
</tr>
<tr>
<td>@MyHelper.decodeNull((int)item.Id)</td>
<td>@MyHelper.decodeNull(item.DefinitionID)</td>
<td>@MyHelper.decodeNull(item.Title)</td>
<td>@MyHelper.decodeNull(item.URL)</td>
<td>@MyHelper.decodeNull(item.Status)</td>
<td>@MyHelper.decodeNull(item.ReferenceID)</td>
</table>
</a>
<a href="@Url.Action("DeleteOval", "Editing", new { vulnId = Model.Id, currentOvalId = item.Id, currentOvalTitle = item.Title})">Delete</a>
</li>
}
</ul>
如您所见,这个 ListView 由一些行组成,每一行都分为两个主要区域:第一个区域包含一些文本信息,第二个区域包含删除 X 按钮代表:
<a href="@Url.Action("DeleteOval", "Editing", new { vulnId = Model.Id, currentOvalId = item.Id, currentOvalTitle = item.Title})">Delete</a>
现在我的问题是,如果用户点击第一个信息区域,它会收到以下错误消息,我希望该区域不可点击\链接:
“/”应用程序中的服务器错误。参数字典包含一个 不可为空类型“System.Int64”的参数“id”的空条目 方法'System.Web.Mvc.ActionResult Details(Int64)' 'MyWebApplication.Controllers.ProductController'。一个可选的 参数必须是引用类型、可为空的类型或声明为 一个可选参数。参数名称:参数说明:一个 当前 web 执行过程中发生未处理的异常 要求。请查看堆栈跟踪以获取有关 错误及其源自代码的位置。
异常详细信息:System.ArgumentException:参数字典 包含不可为空类型的参数“id”的空条目 方法“System.Web.Mvc.ActionResult Details(Int64)”的“System.Int64” 在“MyWebApplication.Controllers.ProductController”中。一个可选的 参数必须是引用类型、可为空的类型或声明为 一个可选参数。参数名称:参数
来源错误:
在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。
堆栈跟踪:
[ArgumentException: 参数字典包含一个空条目 对于方法的不可空类型“System.Int64”的参数“id” 'System.Web.Mvc.ActionResult 详细信息(Int64)' 在 'MyWebApplication.Controllers.ProductController'。一个可选的 参数必须是引用类型、可为空的类型或声明为 一个可选参数。参数名称:参数]
System.Web.Mvc.ActionDescriptor.ExtractParameterFromDictionary(ParameterInfo 参数信息,IDictionary2 parameters, MethodInfo methodInfo) +8152 个参数)+315
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,ActionDescriptor actionDescriptor,IDictionary`2 参数)+60
System.Web.Mvc.Async.ActionInvocation.InvokeSynchronousActionMethod() +76 .................................... ……………………………………………………………………………………………………………………………………………… ..................................................... ………………………………………………………………………………………………………………………………………… ..................................................... ......................................
如何从这个信息区中删除 HTML 链接。
Tnx
【问题讨论】:
标签: jquery asp.net .net jquery-ui jquery-mobile