jquery 테마를 사용하는 ASP.NET MVC2 애플리케이션을 작성하고 있습니다. Ajax 호출로 업데이트 된 부분 뷰가 있습니다. 부분 뷰를 다시 렌더링하면 단추가 jquery 테마를 잃게됩니다. 나는 "onComplete"함수가 그것들을 재 스타일 화하도록 시도했지만 행운은 없었다. 마스터 페이지ASP.NET MVC2 App Ajax 통화에서 jquery UI 테마를 잃는 중
JS 기능 :
function styleControls() {
$("input:submit, button").button();
}
부분도. 제출 버튼은로드시 올바르게 스타일이 적용되지만 Ajax 호출이 스타일을 업데이트 할 때 스타일을 지정하지 않습니다.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MVCBugTracker.ViewModels.ProjectPriorityViewModel>" %>
<div id="priorities">
<% if (Model.Priorities.Count > 0)
{ %>
<table id="priority-table">
<tr>
<th>
</th>
<th>
Priorities
</th>
<th>
Image
</th>
</tr>
<% foreach (var item in Model.Priorities)
{ %><tr id="#row-<%: item.PriorityID %>">
<td>
<%: Ajax.ActionLink("Delete", "DeletePriority", new { id = item.PriorityID }, new AjaxOptions { UpdateTargetId = "priorities", OnFailure = "handleFailure", OnComplete="styleControls", Confirm = "Are you sure you want to delete this Priority?" })%>
</td>
<td>
<%: item.Name%>
</td>
<td style="text-align: center;">
<img src="<%: ResolveUrl(item.ImageUrl) %>" alt="" />
</td>
</tr>
<% } %>
</table>
<% } %>
<% using (Ajax.BeginForm("AddPriority", "Project", new { id = Model.ProjectID }, new AjaxOptions { UpdateTargetId = "priorities", OnFailure = "handleFailure", OnComplete = "styleControls" }))
{ %>
<p>
<label for="name">
Priority Name:</label>
<%: Html.TextBox("priorityname", "")%></p>
<p>
<% int count = 0;
foreach (string s in Model.ImagesUrls)
{%>
<input type="radio" name="imageurl" value="<%: s %>" <%= count == 0 ? "checked=\"checked\"" : "" %> /><img src="<%: ResolveUrl(s) %>" alt="" />
<% count++;
} %>
</p>
<p>
<input type="submit" value="Submit" /></p>
<% } %>
<span id="priority-message" class="field-validation-error">
<% if (Model.Message != null)
{ %>
<%: Model.Message%>
<% } %>
</span>
</div>
부분보기는 jquery 탭 안에 있습니다.
일부 코드를 보여 주시겠습니까? –