該燒成AJAX工具提示是使用Razor視圖引擎MVC3 vb.net應用..從剃刀表項目上懸停
基本上什麼,我試圖做使用This的表使用的Ajax工具提示中的項目。 我面臨的問題是我想使用一個視圖,我已經設置了需要動態填充的數據。當用戶將鼠標懸停在AJAX工具提示應該是火,然後從視圖中填寫相應信息的提示.. 這是該網站說,是我想要的工具提示顯示需要什麼ID:
<a href="#" title="ajax:external.htm">Some link</a>
所以我的問題是我怎麼走:
@Html.ActionLink("Details", "Registrant_Details", New With {.id = currentitem.id})
,並使其在<a href="#" title="ajax:external.htm">Some link</a>
工作還是真的,即使這是可能的...
所在的區域,我在看起來像這樣這樣做:
@For Each item In Model
Dim currentitem = item
rowchanger += 1
If rowchanger Mod 2 = 0 Then
@<tr>
<td style="background-color: #e8eef4">
<a href="#" title="ajax: @Url.Content("~/Views/Admin/Registrant_Details", New With {.id = currentitem.id})")">@Html.DisplayFor(Function(modelItem) currentitem.id)</a>
</td>
<td style="background-color: #e8eef4">
@Html.DisplayFor(Function(modelItem) currentitem.first_name)
</td>
<td style="background-color: #e8eef4">
@Html.DisplayFor(Function(modelItem) currentitem.middle_initial)
</td>
這也顯示了我想實現的目標。忽略國防部說法,那就是在表格中交替行的顏色物品的樣式..
任何幫助將不勝感激..
附加信息:
我也試着這樣做:
<a href="#" title="ajax:@Url.Action("Registrant_Details","Admin", New With {.id = currentitem.id})">@Html.DisplayFor(Function(modelItem) currentitem.id)</a>
這正是我想它應該是...問題是有什麼發生。當我將鼠標懸停在ID ...
上面已更正,以便將正確的參數傳遞給@ Url.Action(「Action Name」,「ControllerName」),並且在懸停時無法正常工作,Chrome的底部顯示正確的地址,但它幾乎就像JavaScript的不是射擊......因此,我將張貼節以及
<style type="text/css">
.ajaxtooltip{
position: absolute; /*leave this alone*/
display: none; /*leave this alone*/
width: 300px;
left: 0; /*leave this alone*/
top: 0; /*leave this alone*/
background: lightyellow;
border: 2px solid gray;
border-width: 1px 2px 2px 1px;
padding: 5px;
}
</style>
<script src="@Url.Content("~/Scripts/ajaxtooltip.js")" type="text/javascript">
/***********************************************
* Ajax Tooltip script- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/
</script>