why i am getting popup message when I am tryiing to update user.
Posted
by kumar
on Stack Overflow
See other posts from Stack Overflow
or by kumar
Published on 2010-05-22T15:30:39Z
Indexed on
2010/05/22
15:41 UTC
Read the original article
Hit count: 254
I am getting Popup mesage something like
You have chosen to open
Update
which is a:application/json From : http://localhost:1234
which ok cancel buttons..
I am using this code to run..
[HttpPost]
public JsonResult MEdit(ExpenseBE e)
{
var cache = CacheFactory.GetCacheManager();
string F_ACTION = "U";
string F_DEBUG = "Y";
var excUpdateStatus = false;
for (int i = 0; i <= cache.Count; i++)
{
var x = (ExpenseBE)cache.GetData("a" + i);
if (x != null)
{
string Resolutioncode = e.Exception.ResolutionCode;
string reasoncode = e.Exception.ReasonCode;
string actioncode = e.Exception.ActionCode;
e.Exception.ExceptionID = x.Exception.ExceptionID;
e.Exception.ReasonCode = reasoncode;
e.Exception.ReasonCode = Resolutioncode;
e.Exception.ActionCode = actioncode;
e.Exception.Sequence = x.Exception.Sequence;
e.Exception.FollowupDate = x.Exception.FollowupDate;
e.Exception.IOL = x.Exception.IOL;
e.Exception.LastUpdateUser = User.Identity.Name.ToUpper().Remove(0, 4);
excUpdateStatus = common.UpdateException(e.Exception, F_ACTION, F_DEBUG);
}
}
return Json(excUpdateStatus.ToString());
}
and my view is
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NorthernTrust.ATP.iTool.Core.Business.Entities.Specialist.ExpenseBE>" %>
<% using (Html.BeginForm("MEdit", "expense", FormMethod.Post))
{ %>
<%= Html.ValidationSummary(true)%>
<fieldset class="clearfix" id="fieldset-exception">
<legend>Mass Edit Exception Information</legend>
<div class="fiveper">
<label for="ExceptionStatus">
Status:
<span> </span>
</label>
<label for="ResolutionCode">
Resolution:
<span>
<%=Html.DropDownListFor(model=>model.Exception.ResolutionCode,new SelectList(Model.LookupCodes["C_EXCPT_RESL"], "Key", "Value"))%>
</span>
</label>
<label for="ReasonCode">
Reason:
<span><%=Html.DropDownListFor(model => model.Exception.ReasonCode, new SelectList(Model.LookupCodes["C_EXCPT_RSN"], "Key", "Value"))%></span>
</label>
<label for="ExceptionStatus">
Action Taken:
<span><%=Html.DropDownListFor(model => model.Exception.ActionCode, new SelectList(Model.LookupCodes["C_EXCPT_ACT"], "Key", "Value"))%></span>
</label>
</div>
<div class="fiveper">
<label for="FollowupDate">
Follow-up:
<span><input type="text" id="exc-flwup-" /></span>
<%--<%=Html.EditorFor(model=>model.Exception.FollowupDate) %>--%>
</label>
<label for="IOL">
Inquiry #:
<%=Html.TextBox("Inquiery", ViewData["inq"] ?? "")%>
</label>
<label>Comment</label>
<span>
<%=Html.TextArea("value") %>
<%=Html.ValidationMessage("value")%>
</span>
</div>
<br />
<br />
<div>
<button id="btnSelect" class="button">Select All</button>
<button id="btnCancel" class="button">Cancel</button>
<input type="submit" class="button" value="Save" />
</div>
</fieldset>
<% } %>
<script type="text/javascript">
$(document).ready(function() {
$('#btnSelectAll').click(function() {
function validate_excpt(formData, jqForm, options) {
var form = jqForm[0];
}
$('#btnSelect').click(function() {
$('#input [type=checkbox]').attr('checked', 'checked');
});
// post-submit callback
function showResponse(responseText, statusText, xhr, $form) {
if ('success' == statusText) {
$('#error-msg span:last').html('<strong>Update successful.</strong>');
} else {
$('#error-msg span:last').html('<strong>Update failed.</strong> ' + responseText);
}
$('#error-msg').removeClass('hide');
}
$('#exc').ajaxForm({
target: '#error-msg',
beforeSubmit: validate_excpt,
success: showResponse,
dataType: 'json'
});
$('.button').button();
});
$('.button').button();
$("input[id^='exc-flwup-']").datepicker({
duration: '',
showTime: true,
constrainInput: true,
stepMinutes: 30,
stepHours: 1,
altTimeField: '',
time24h: true,
minDate: 0
});
$('#ui-timepicker-div').bgiframe();
});
</script>
please correct me if i am doing somwhere wrong? thanks
© Stack Overflow or respective owner