编辑后的bowser问题是在db中更新但在视图页面中没有 [英] bowser problem after editing it is updating in db but not in view page

查看:45
本文介绍了编辑后的bowser问题是在db中更新但在视图页面中没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑后ie11没有更新但是在db中更新所以如果我刷新页面它正在更新bt它在其他浏览器中工作如果我在编辑后将控制点放在其他浏览器中去了查看页面但是在IE11中它是没去过查看页面?

emp1.cshtml





@model iqmsampleworks_project.Areas.admin.Models .projecttypedto







@ {

ViewBag.Title =emp1 ;

布局=〜/ Areas / admin / Views / Shared / _LayoutPage1.cshtml;

@ Styles.Render(〜/ Content / css / style( 2).css)

@ Styles.Render(〜/ Content / themes / base / css)

}





@ {

var fileName =;

if(IsPost)

{

var fileSavePath =;

var uploadedFile = Request.Files [0];

fileName = Path.GetFileName(uploadedFile.FileName );

fileSavePath =服务r.MapPath(〜/ App_Data / UploadedFiles /+

fileName);

uploadedFile.SaveAs(fileSavePath);

}

}

< script src =@ Url.Content(〜/ Scripts / jquery-1.7.1.min.js)>< / script>

< link rel =stylesheettype =text / csshref =@ Url.Content(〜/ Content / themes1 / yui / style2.css)/>

< script src =@ Url.Content(〜/ Content / js / jquery.tablesorter-2.0.3.js)type =text / javascript>< / script> ;

< script src =@ Url.Content(〜/ Content / js / jquery.tablesorter.filer.js)type =text / javascript>< / script> ;

< script type =text / javascript>



$(document).ready(function(){













$(#yui)。tablesorter({debug:false,sortList:[[0,0]],小部件:['zebra']})

.tablesorterFilter({

filterContainer:$(#filterBox),

filterClearContainer:$(#filterClear),

filterColumns: [0,1],

filterCaseSensitive:false

});

});

< /脚本>



@using(Html.BeginForm())

{

@ Html.AntiForgeryToken()

@ Html.ValidationSummary(true)





查看员工





















技术





@ Html.DropDownListFor(model => model.TID1,

new SelectList((System.Collections.IEnumerable)ViewData [ddldesig] ,tid,技术),

选择技术

,新{id =tech2,@ Style =宽度:170px;高度:25px ;})

@ Html.ValidationMessageFor(model => model.TID1)





< br $>








$(#tech2) .change(function(){





var cat = $(this).val();

$ .get('@ Url.Action(viewemp)?id ='+ cat,function(r){



$('#div') .html(r);

});



});



var cat = $('#tech2')。val();

if(cat!= ''){





$ .get('@ Url.Action(viewemp)?id ='+ cat,function (r){

$('#div')。html(r);

});

}



< / script>



}

viewemp.cshtml

@model IEnumerable< iqmsampleworks_project.areas.admin.models.projecttypedto>







@ {

ViewBag.Title =viewemp;



@ Styles.Render(〜/ Content / css / style(2).css )

@ Styles.Render(〜/ Content / themes / base / css)



}



< script src =〜/ Scripts / jquery.tablesorter.pager.js>< / script>

< script type =text / javascript>



$(文件).ready(function(){







函数LoadOnce(){

window.loca tion.reload();

}





$(#yui)。tablesorter({ debug:false,sortList:[[0,0]],小部件:['zebra']})

.tablesorterFilter({

filterContainer:$(#filterBox ),

filterClearContainer:$(#filterClear),

filterColumns:[0,1],

filterCaseSensitive:false

});

$(#yui)。tablesorterPager({container:$(#pagerOne),positionFixed:false,size:5});

});

< / script>









































@if(模特!= null&& Model.Count()> 0)

{



foreach(型号中的var项目)

{

b / b










< br $>
}



}

其他

{



}

搜索:

< input name =filterid =filterBoxvalue =maxlength = 30size =30type =text/>< input type =buttonvalue =GOclass =myButton1onclick =Register/>



@ Html.DisplayName(Name) @ Html.DisplayName(Edit) @ Html.DisplayName(删除)
@ item.name @ Html.ActionLink(Edit,editemp,new {id = item.eid},new { @class =EditImg}) @ Html.ActionLink(删除,删除,新{id = item.eid},新{@class = DeleteImg})
< label style =float:left; padding-left:320px; color:Red; font-weight:bold; margin -top:30px; margin-bottom:20px;>未找到数据!。< / label>

< img style =vertical-align:middlesrc =@ Url.Content(〜/ Content / first.png)class =first/> ; 

< img style =vertical-align:middlesrc =@ Url.Content(〜/ Content / prev.png)class =prev/>  

< input type =textclass =pagedisplaystyle =width:30px;边框:1px solid#999; text-align:center;身高:20px/> 

< img style =vertical-align:middlesrc =@ Url.Content(〜/ Content / next.png)class = next/> 

< img style =vertical-align:middlesrc =@ Url.Content(〜/ Content / last.png)class = last/>

        

< select class =pagesizestyle =height: 24px>

<选择选项=已选择值=5> 5< /选项>

<选项值=10> 10< / option>

< option value =20> 20< / option>

< option value =30> 30< / option> ;



< / select>

 每页








editemp.cshtml

@model iqmsampleworks_project。 Areas.admin.Models.projecttypedto

@ {

ViewBag.Title =editemp;

Layout =〜/ Areas / admin /观看/共享/ _LayoutPage1.cshtml;

}





@using(Html.BeginForm() )

{

@ Html.ValidationSummary(true)





添加员工





















技术





@ Html.DropDownListFor(model => model.TID1,

new SelectList((System.Collections.IEnumerable)ViewData [ddldesig],tid,technology) ,

选择价值,

新{})

@ Html.ValidationMessageFor(model => model.TID1)







名称





@ Html.EditorFor(model => model.name)

@ Html.ValidationMessageFor(model => model.name)











< input type =submitvalue =Updateclass =myButtonstyle =width:auto/>



< button type =buttonid =qqclass =myButton>取消< / button>













}

< script type =text / javascript>

$(#qq)。click(function(event)

{

var url ='@ Url.Action(emp1)/ @ Model.TID1';

window.location.href = url

});

< / script>

和我的控制器

 public ActionResult emp1(int?id)
{

List < domain > designations = db.domains.ToList();
ViewData [ddldesig] =名称;
列表< span class =code-keyword>< emptable > clist = db.emptables.Where(a => a.TID1 == id)。ToList();
列表< projecttypedto > dto = new List < projecttypedto > < /跨度>();
projecttypedto cdto = new projecttypedto();
if(id!= 0&& id!= null)
cdto.TID1 =(int)id;

return View(cdto);
}
public ActionResult editemp(int id)
{
List < > designations = db.domains.ToList();
ViewData [ddldesig] =指定;
emptable qu = db.emptables.SingleOrDefault(e => e.eid == id);

projecttypedto p = new projecttypedto();
p.TID1 = qu.TID1;
p.name = qu.name;
return View(p);
}
[HttpPost]
public ActionResult editemp(projecttypedto prj,int id)
{
List < domain > domains = db.domains.ToList();
ViewData [ddldesig] =域名;
emptable p = db.emptables.SingleOrDefault(e => e.eid == id);

p.TID1 = prj.TID1;
p.name = prj.name;
int id1 = Convert.ToInt32(p.TID1);
db.SaveChanges();

返回RedirectToAction(emp1,new {id = p.TID1});

}
public ActionResult viewemp(int id)
{
List < > designations = db.domains.ToList();
ViewData [ddldesig] =指定;
列表< emptable > clist = db.emptables.Where(a => a.TID1 == id).ToList();
列表< projecttypedto > dto = new List < projecttypedto > < /跨度>();
foreach(var s in clist)
{
projecttypedto c = new projecttypedto();
c.name = s.name;
c.eid = s.eid;

dto.Add(c);

}
return View(dto);

}

解决方案

(文件).ready(function(){













(#yui)。tablesorter({debug:false,sortList:[[0,0]],小部件:['zebra']})

.tablesorterFilter( {

filterContainer:


(#filterBox),

filterClearContainer:


in ie11 after editing its is not updating but updting in db so if i refresh page it is updating bt it is working in other browser if i put control point in other browsers after editing it went to view page but in IE11 it is not went to view page?
emp1.cshtml


@model iqmsampleworks_project.Areas.admin.Models.projecttypedto



@{
ViewBag.Title = "emp1";
Layout = "~/Areas/admin/Views/Shared/_LayoutPage1.cshtml";
@Styles.Render("~/Content/css/style (2).css")
@Styles.Render("~/Content/themes/base/css")
}


@{
var fileName = "";
if (IsPost)
{
var fileSavePath = "";
var uploadedFile = Request.Files[0];
fileName = Path.GetFileName(uploadedFile.FileName);
fileSavePath = Server.MapPath("~/App_Data/UploadedFiles/" +
fileName);
uploadedFile.SaveAs(fileSavePath);
}
}
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")"></script>
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes1/yui/style2.css")" />
<script src="@Url.Content("~/Content/js/jquery.tablesorter-2.0.3.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/js/jquery.tablesorter.filer.js")" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function () {






$("#yui").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
.tablesorterFilter({
filterContainer: $("#filterBox"),
filterClearContainer: $("#filterClear"),
filterColumns: [0, 1],
filterCaseSensitive: false
});
});
</script>

@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)


View Employees











Technology



@Html.DropDownListFor(model => model.TID1,
new SelectList((System.Collections.IEnumerable)ViewData["ddldesig"], "tid", "technology"),
"Select technology"
, new { id = "tech2", @Style = "width:170px;height:25px;"})
@Html.ValidationMessageFor(model => model.TID1)








$("#tech2").change(function () {


var cat = $(this).val();
$.get('@Url.Action("viewemp")?id=' + cat, function (r) {

$('#div').html(r);
});

});

var cat = $('#tech2').val();
if (cat != '') {


$.get('@Url.Action("viewemp")?id=' + cat, function (r) {
$('#div').html(r);
});
}

</script>

}
viewemp.cshtml
@model IEnumerable<iqmsampleworks_project.areas.admin.models.projecttypedto>



@{
ViewBag.Title = "viewemp";

@Styles.Render("~/Content/css/style (2).css")
@Styles.Render("~/Content/themes/base/css")

}

<script src="~/Scripts/jquery.tablesorter.pager.js"></script>
<script type="text/javascript">

$(document).ready(function () {



function LoadOnce() {
window.location.reload();
}


$("#yui").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
.tablesorterFilter({
filterContainer: $("#filterBox"),
filterClearContainer: $("#filterClear"),
filterColumns: [0, 1],
filterCaseSensitive: false
});
$("#yui").tablesorterPager({ container: $("#pagerOne"), positionFixed: false, size: 5 });
});
</script>




















@if (Model != null && Model.Count() > 0)
{

foreach (var item in Model)
{







}

}
else
{

}
Search:
<input name="filter" id="filterBox" value="" maxlength="30" size="30" type="text" /><input type="button" value="GO" class="myButton1" onclick="Register" />

@Html.DisplayName("Name" )@Html.DisplayName("Edit")@Html.DisplayName("Delete")
@item.name @Html.ActionLink("Edit", "editemp", new { id = item.eid }, new { @class = "EditImg" }) @Html.ActionLink("Delete", "deleteemp", new { id=item.eid },new {@class = "DeleteImg"})
<label style="float:left;padding-left:320px;color:Red;font-weight:bold;margin-top:30px;margin-bottom:20px;">No data found !.</label>
<img style="vertical-align:middle" src="@Url.Content("~/Content/first.png")" class="first" /> 
<img style="vertical-align:middle" src="@Url.Content("~/Content/prev.png")" class="prev" /> 
<input type="text" class="pagedisplay" style="width: 30px; border: 1px solid #999; text-align: center; height: 20px" /> 
<img style="vertical-align:middle" src="@Url.Content("~/Content/next.png")" class="next" /> 
<img style="vertical-align:middle" src="@Url.Content("~/Content/last.png")" class="last" />
        
<select class="pagesize" style="height: 24px">
<option selected="selected" value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>

</select>
 per page




editemp.cshtml
@model iqmsampleworks_project.Areas.admin.Models.projecttypedto
@{
ViewBag.Title = "editemp";
Layout = "~/Areas/admin/Views/Shared/_LayoutPage1.cshtml";
}


@using (Html.BeginForm())
{
@Html.ValidationSummary(true)


Add Employees











Technology



@Html.DropDownListFor(model => model.TID1,
new SelectList((System.Collections.IEnumerable)ViewData["ddldesig"],"tid","technology"),
"Select Value",
new { })
@Html.ValidationMessageFor(model => model.TID1)




Name



@Html.EditorFor(model => model.name)
@Html.ValidationMessageFor(model => model.name)






<input type="submit" value="Update" class="myButton" style="width:auto" />


<button type="button" id="qq" class="myButton">Cancel</button>







}
<script type="text/javascript">
$("#qq").click(function (event)
{
var url = '@Url.Action("emp1")/@Model.TID1';
window.location.href = url
});
</script>
and my controller

public ActionResult emp1(int? id)
      {

          List<domain> designations = db.domains.ToList();
          ViewData["ddldesig"] = designations;
          List<emptable> clist = db.emptables.Where(a => a.TID1 == id).ToList();
          List<projecttypedto> dto = new List<projecttypedto>();
          projecttypedto cdto = new projecttypedto();
          if (id != 0 && id != null)
              cdto.TID1 = (int)id;

          return View(cdto);
      }
      public ActionResult editemp(int id)
      {
          List<domain> designations = db.domains.ToList();
          ViewData["ddldesig"] = designations;
          emptable qu = db.emptables.SingleOrDefault(e => e.eid == id);

          projecttypedto p = new projecttypedto();
          p.TID1 = qu.TID1;
          p.name = qu.name;
          return View(p);
      }
      [HttpPost]
      public ActionResult editemp(projecttypedto prj, int id)
      {
          List<domain> domains = db.domains.ToList();
          ViewData["ddldesig"] = domains;
          emptable p = db.emptables.SingleOrDefault(e => e.eid == id);

          p.TID1 = prj.TID1;
          p.name = prj.name;
          int id1 = Convert.ToInt32(p.TID1);
          db.SaveChanges();

          return RedirectToAction("emp1", new { id= p.TID1});

      }
      public ActionResult viewemp(int id)
      {
          List<domain> designations = db.domains.ToList();
          ViewData["ddldesig"] = designations;
          List<emptable> clist = db.emptables.Where(a => a.TID1 == id).ToList();
          List<projecttypedto> dto = new List<projecttypedto>();
          foreach (var s in clist)
          {
              projecttypedto c = new projecttypedto();
              c.name = s.name;
              c.eid = s.eid;

              dto.Add(c);

          }
          return View(dto);

      }

解决方案

(document).ready(function () {







("#yui").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
.tablesorterFilter({
filterContainer:


("#filterBox"),
filterClearContainer:


这篇关于编辑后的bowser问题是在db中更新但在视图页面中没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆