---
title: "screen is called two times"  
description: "screen is called two times"  
author: "Niels Albert"  
published: 2014-10-17  
updated: 2014-10-21  
canonical: https://www.mindstick.com/forum/2406/screen-is-called-two-times  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 13 minutes  

---

# screen is called two times

Hi everybody,\
I have this:\
I have this:\
View:\
@model ContosoUniversity.Models.UserProfile @{ ViewBag.Title = "Edit"; } <h2>EDIT</h2> <div id="tabs"> <ul> <li><a href="#tabs-1">[Personal information](https://answers.mindstick.com/qa/102585/how-to-secure-personal-information-on-a-laptop)</a></li> <li><a href="#tabs-2">Photos</a></li> <li><a href="#tabs-3">The Bike</a></li> </ul> <div id="tabs-1"> @using (Html.BeginForm("Edit", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) { @[Html.AntiForgeryToken](https://www.mindstick.com/interview/34225/how-to-call-html-antiforgerytoken-in-asp-dot-net-web-api)() <div class="form-horizontal"> <h4>Lola Biker</h4> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Id) <form class="form-horizontal"> @[Html.ActionLink](https://www.mindstick.com/forum/157896/what-is-the-difference-between-the-html-actionlink-and-ajax-actionlink-helpers-in-asp-dot-net-mvc)("Change your password", "Manage") <div class="form-group"> @Html.LabelFor(m => m.UserName, new { @class = "control-label col-xs-2" }) @[Html.TextBoxFor](https://www.mindstick.com/forum/33953/what-is-the-difference-between-html-textbox-vs-html-textboxfor)(m => m.UserName, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.Email, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.Email, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group "> @Html.LabelFor(m => m.FirstName, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control", style = "width: 250px;" }) </div> <div class=" form-group"> @Html.LabelFor(m => m.LastName, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.LastName, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.Motto, new { @class = "control-label col-xs-2" }) @Html.TextAreaFor(m => m.Motto, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.PlaceOfBirth, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.PlaceOfBirth, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.HowManyBikes, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.HowManyBikes, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.BesideYourBeth, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.BesideYourBeth, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.NicestRide, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.NicestRide, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.WorstRide, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.WorstRide, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.AmountKmPerYear, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AmountKmPerYear, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.AverageSpeed, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AverageSpeed, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.AbleToChatWhileRiding, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AbleToChatWhileRiding, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.PhoneNumber, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.PhoneNumber, new { @class = "form-control", style = "width: 250px;" }) </div> </form> <br /> <div class="pull-left"> <div class="col-md-offset-0"> <input type="submit" value="Save" class="btn btn-default pull-left" /> </div> </div> </div> } <br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div> </div> <div id="tabs-2"> <div id="tabs-2"> @using ([Ajax.BeginForm](https://www.mindstick.com/forum/157892/how-can-the-ajax-actionlink-and-ajax-beginform-use-to-create-ajax-enabled-links-and-forms-in-mvc)("EditPhotos", "Account", new AjaxOptions() { HttpMethod = "POST" }, new { enctype = "multipart/form-data" } )) //new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() <div class="form-horizontal"> <h4>Photos</h4> <hr /> @Html.HiddenFor(model => model.Id) <form class="form-horizontal"> <div class="editor-label"> @Html.LabelFor(model => model.DisplayItem) </div> <div class="editor-field"> @Html.EditorFor(model => model.DisplayItem) </div> <div id="upload-choices"> <div class="editor-label"> @Html.LabelFor(m => m.Image) @Html.ValidationMessageFor(model => model.Image) </div> <div class="editor-row"> @Html.ValidationSummary(true) </div> </div> <br /> <div class="table-responsive"> <table class="table"> <tr> <th><img width="200" height="150" src="@Url.Action("GetImage", "Account", new { id = Model.Id })"></th> </tr> </table> </div> <input type="file" name="file" class="filestyle" data-buttontext="Find file"> </form> <br /> <div class="progress progress-striped"> <div class="progress-bar progress-bar-success">0%</div> </div> <div id="status"></div> <br /> @*@Html.ActionLink("Upload photos", "Upload")*@ <div class="pull-left"> <div class="col-md-offset-0"> <input type="submit" value="Save" id="Id" class="btn btn-default pull-left" /> </div> </div> </div> } <br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div> </div> <div id="tabs-3"> Content for Tab 3 goes here.<br /> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </div> </div> <br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div> @section Scripts { <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.11.0.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap-filestyle.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.min.js")" type="text/javascript"></script> <script> $(document).ready(function () { $("#tabs").tabs(); // $(document).on("click", ".btn", function () { // $("#tabs").tabs("select", window.location.hash); // $(":file").filestyle({ size: "sm" }); // $(":file").filestyle({ buttonText: "Find file" }); //}); }); $(document).ready(function () { var bar = $('.progress-bar'); var percent = $('.progress-bar'); var status = $('#status'); $('form').ajaxForm({ beforeSend: function () { status.empty(); var percentVal = '0%'; bar.width(percentVal) percent.html(percentVal); }, uploadProgress: function (event, position, total, percentComplete) { var percentVal = percentComplete + '%'; bar.width(percentVal) percent.html(percentVal); }, success: function () { var percentVal = '100%'; bar.width(percentVal) percent.html(percentVal); }, complete: function (xhr) { status.html(xhr.responseText); } }); })(); </script> }\
and [controller action](https://www.mindstick.com/forum/34400/how-to-retrieve-form-values-in-controller-action):\
[HttpPost] public ActionResult EditPhotos(UserProfile userprofile,HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { // extract only the fielname var fileName = Path.GetFileName(file.FileName); // store the file inside ~/App_Data/uploads folder var path = Path.Combine([Server.MapPath](https://www.mindstick.com/forum/2132/server-mappath-in-asp-dot-net)("~/App_Data/uploads"), fileName); file.SaveAs(path); } if ([ModelState.IsValid](https://www.mindstick.com/forum/2002/modelstate-isvalid-contains-errors-when-using-mongodb)) { string username = User.Identity.Name; // Get the userprofile UserProfile user = db.userProfiles.FirstOrDefault(u => u.UserName.Equals(username)); // Update fields user.Image = new byte[file.ContentLength]; file.InputStream.Read(user.Image, 0, file.ContentLength); user.ImageMimeType = file.ContentType; db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return Redirect(Url.Action("Edit", "Account") + "#tabs-2"); } return PartialView(userprofile); }\
it goes about tab2\
but after I put on save, the view was rendering two times, so I put a breakpoint on this line:\
`user.Image = new byte[file.ContentLength];`, I get the messagee:\
An exception of type 'System.NullReferenceException' occurred in ContosoUniversity.dll but was not handled in user code [Additional information](https://www.mindstick.com/forum/160484/error-failed-to-launch-debug-adapter-additional-information-may-be-available-in-the-output-window): Object reference not set to an [instance of an object](https://www.mindstick.com/forum/376/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object). file = null\
but if I after continue, then it loops again and saves the file to database. But so the first time is file = null, but if I continue the file is saved, but also the view is now showing correctly after saving the image.\
![screen is called two times](https://www.mindstick.com/mindstickforums/55749768-fdef-49ce-ab21-0ccd0696e4c1/images/2a5e7bb2-5406-4b9c-9424-332e4ad530aa.png)\
\
\
after uploading:\
![screen is called two times](https://www.mindstick.com/mindstickforums/55749768-fdef-49ce-ab21-0ccd0696e4c1/images/597d24a4-2a35-42f4-94e5-84657162eedc.png)\
Thank you

## Replies

### Reply by John Smith

no success yet buddy? \

### Reply by Niels Albert

Somebody there?

### Reply by Niels Albert

Hi Rohit,\
but you have some other tips?\
Thank you

### Reply by Niels Albert

Hi Rohit,\
this is my model class:\
public partial class UserProfile {\
public int Id { get; set; }\
public string UserName { get; set; } //[Required(ErrorMessage = "Name is required.")] //[StringLength(5, ErrorMessage = "FirstName cannot be longer than 40 characters.")] //[RegularExpression(@"^[a-zA-Z]+$", ErrorMessage = "Use letters only please")] [Display(Name = "First Name")] public string FirstName { get; set; } //[RegularExpression(@"^[a-zA-Z]+$", ErrorMessage = "Use letters only please")] //[MaxLength(40, ErrorMessage = "LastName cannot be longer than 40 characters.")] [Display(Name = "Last Name")] public string LastName { get; set; } public string Email { get; set; }\
//[RegularExpression(@"^[a-zA-Z]+$", ErrorMessage = "Use letters only please")] [Display(Name = "Motto")] public string Motto { get; set; } //[RegularExpression(@"^[a-zA-Z]+$", ErrorMessage = "Use letters only please")] [Display(Name = "Place of birth")] public string PlaceOfBirth { get; set; } [Display(Name = "How many bikes")] public int HowManyBikes { get; set; } [Display(Name = "Are they beside your bed")] public string BesideYourBeth { get; set; } [Display(Name = "Nicest ride")] public string NicestRide { get; set; } [Display(Name = "Worst ride")] public string WorstRide { get; set; } [Display(Name = "Amount of k's per year")] public string AmountKmPerYear { get; set; } [Display(Name = "Average speed")] public string AverageSpeed { get; set; } [Display(Name = "Able to chat while riding")] public string AbleToChatWhileRiding { get; set; } [Display(Name = "Phone number")] public string PhoneNumber { get; set; } public string Picture { get; set; }\
[Column(TypeName = "image")]\
\
[DisplayName("Image")] [MaxLength] //[AvalidFile(Allowed = new string[] { ".doc", ".docx", ".png", ".jpeg", ".jpg" }, //MaxLength = 1024 * 1024 * 3, //ErrorMessage = "Error The file should word or image and with size 3M try again!")] public byte[] Image { get; set; }\
[Display(Name = "Display profile Image")] public bool DisplayItem { get; set; }\
[DisplayName("ImageMimeType")] public string ImageMimeType { get; set; }\
public virtual ICollection<LolaBikePhoto> LolaBikePhotos { get; set; } //public bool IsFile { get; set; } //[Range(0, int.MaxValue)] //public int X { get; set; } //[Range(0, int.MaxValue)] //public int Y { get; set; } //[Range(1, int.MaxValue)] //public int Width { get; set; } //[Range(1, int.MaxValue)] //public int Height { get; set; } }

### Reply by Chris Anderson

please paste your Model class here, so I can check by putting on my side.\

### Reply by Niels Albert

No, I just comment the form of first tab out. But I see it now like this:\
And this is the code:\
@model ContosoUniversity.Models.UserProfile@{ ViewBag.Title = "Edit";}\
<h2>EDIT</h2>\
\
<div id="tabs">\
<ul> <li><a href="#tabs-1">Personal information</a></li> <li><a href="#tabs-2">Photos</a></li> <li><a href="#tabs-3">The Bike</a></li> </ul>\
<div id="tabs-1"> hoi\
\
\
\
\
</div>\
<div id="tabs-2"> @using (Ajax.BeginForm("EditPhotos", "Account", new AjaxOptions() { HttpMethod = "POST" }, new { enctype = "multipart/form-data" } ))\
//new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken()\
<div class="form-horizontal"> <h4>Photos</h4> <hr /> @Html.HiddenFor(model => model.Id) <form class="form-horizontal">\
<div class="editor-label"> @Html.LabelFor(model => model.DisplayItem) </div> <div class="editor-field"> @Html.EditorFor(model => model.DisplayItem)\
</div>\
<div id="upload-choices"> <div class="editor-label"> @Html.LabelFor(m => m.Image)\
@Html.ValidationMessageFor(model => model.Image) </div> <div class="editor-row"> @Html.ValidationSummary(true) </div> </div>\
<br />\
<div class="table-responsive"> <table class="table">\
<tr> <th><img width="200" height="150" src="@Url.Action("GetImage", "Account", new { id = Model.Id })"></th>\
\
</tr> </table> </div>\
<input type="file" name="file" class="filestyle" data-buttontext="Find file">\
\
</form>\
<br /> <div class="progress progress-striped"> <div class="progress-bar progress-bar-success">0%</div> </div>\
<div id="status"></div>\
\
<br />\
@*@Html.ActionLink("Upload photos", "Upload")*@ <div class="pull-left"> <div class="col-md-offset-0"> <input type="submit" value="Save" id="Id" class="btn btn-default pull-left" />\
</div> </div>\
</div> }\
<br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div>\
</div>\
<div id="tabs-3"> Content for Tab 3 goes here.<br /> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div>\
</div> \
\
\
\
<br /><br /><div> @Html.ActionLink("Back to List", "Index")</div>\
@section Scripts{ <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.11.0.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap-filestyle.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.min.js")" type="text/javascript"></script> <script>\
$(document).ready(function () { $("#tabs").tabs(); // $(document).on("click", ".btn", function () { // $("#tabs").tabs("select", window.location.hash);\
// $(":file").filestyle({ size: "sm" }); // $(":file").filestyle({ buttonText: "Find file" }); //}); });\
$(document).ready(function () {\
var bar = $('.progress-bar'); var percent = $('.progress-bar'); var status = $('#tabs-2')\
$('form').ajaxForm({ beforeSend: function () { status.empty(); var percentVal = '0%'; bar.width(percentVal) percent.html(percentVal); }, uploadProgress: function (event, position, total, percentComplete) { var percentVal = percentComplete + '%'; bar.width(percentVal) percent.html(percentVal); }, success: function () { var percentVal = '100%'; bar.width(percentVal) percent.html(percentVal); }, complete: function (xhr) { status.html(xhr.responseText); } });\
})(); </script>}\
\
\
\
\
\
![screen is called two times](https://www.mindstick.com/mindstickforums/55749768-fdef-49ce-ab21-0ccd0696e4c1/images/2454420e-09c4-43ee-b161-2e357b1037ea.png)\

### Reply by Chris Anderson

yes, Is it working?\

### Reply by Niels Albert

Hi Rohit,\
thank you for you reply, you mean like this:\
\
@model ContosoUniversity.Models.UserProfile@{ ViewBag.Title = "Edit";}\
<h2>EDIT</h2>\
\
<div id="tabs">\
<ul> <li><a href="#tabs-1">Personal information</a></li> <li><a href="#tabs-2">Photos</a></li> <li><a href="#tabs-3">The Bike</a></li> </ul>\
<div id="tabs-1">\
\
@using (Html.BeginForm("Edit", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken()\
<div class="form-horizontal"> <h4>Lola Biker</h4> <hr /> @Html.ValidationSummary(true) @Html.HiddenFor(model => model.Id)\
\
\
<form class="form-horizontal">\
@Html.ActionLink("Change your password", "Manage")\
\
<div class="form-group"> @Html.LabelFor(m => m.UserName, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.UserName, new { @class = "form-control", style = "width: 250px;" }) </div>\
\
\
<div class="form-group"> @Html.LabelFor(m => m.Email, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.Email, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group "> @Html.LabelFor(m => m.FirstName, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class=" form-group"> @Html.LabelFor(m => m.LastName, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.LastName, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.Motto, new { @class = "control-label col-xs-2" }) @Html.TextAreaFor(m => m.Motto, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group">\
@Html.LabelFor(m => m.PlaceOfBirth, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.PlaceOfBirth, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group">\
@Html.LabelFor(m => m.HowManyBikes, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.HowManyBikes, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.BesideYourBeth, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.BesideYourBeth, new { @class = "form-control", style = "width: 250px;" }) </div> <div class="form-group"> @Html.LabelFor(m => m.NicestRide, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.NicestRide, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.WorstRide, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.WorstRide, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.AmountKmPerYear, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AmountKmPerYear, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.AverageSpeed, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AverageSpeed, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.AbleToChatWhileRiding, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.AbleToChatWhileRiding, new { @class = "form-control", style = "width: 250px;" }) </div>\
<div class="form-group"> @Html.LabelFor(m => m.PhoneNumber, new { @class = "control-label col-xs-2" }) @Html.TextBoxFor(m => m.PhoneNumber, new { @class = "form-control", style = "width: 250px;" }) </div>\
\
\
\
</form>\
\
<br />\
\
<div class="pull-left"> <div class="col-md-offset-0"> <input type="submit" value="Save" class="btn btn-default pull-left" />\
</div> </div> </div> }\
<br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div>\
\
\
\
</div>\
<div id="tabs-2"> @using (Ajax.BeginForm("EditPhotos", "Account", new AjaxOptions() { HttpMethod = "POST" }, new { enctype = "multipart/form-data" } ))\
//new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken()\
<div class="form-horizontal"> <h4>Photos</h4> <hr /> @Html.HiddenFor(model => model.Id) <form class="form-horizontal">\
<div class="editor-label"> @Html.LabelFor(model => model.DisplayItem) </div> <div class="editor-field"> @Html.EditorFor(model => model.DisplayItem)\
</div>\
<div id="upload-choices"> <div class="editor-label"> @Html.LabelFor(m => m.Image)\
@Html.ValidationMessageFor(model => model.Image) </div> <div class="editor-row"> @Html.ValidationSummary(true) </div> </div>\
<br />\
<div class="table-responsive"> <table class="table">\
<tr> <th><img width="200" height="150" src="@Url.Action("GetImage", "Account", new { id = Model.Id })"></th>\
\
</tr> </table> </div>\
<input type="file" name="file" class="filestyle" data-buttontext="Find file">\
\
</form>\
<br /> <div class="progress progress-striped"> <div class="progress-bar progress-bar-success">0%</div> </div>\
<div id="status"></div>\
\
<br />\
@*@Html.ActionLink("Upload photos", "Upload")*@ <div class="pull-left"> <div class="col-md-offset-0"> <input type="submit" value="Save" id="Id" class="btn btn-default pull-left" />\
</div> </div>\
</div> }\
<br /><br /> <div> @Html.ActionLink("Back to List", "Index") </div>\
</div>\
<div id="tabs-3"> Content for Tab 3 goes here.<br /> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div>\
</div> \
\
\
\
<br /><br /><div> @Html.ActionLink("Back to List", "Index")</div>\
@section Scripts{ <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.11.0.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap-filestyle.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.form.min.js")" type="text/javascript"></script> <script>\
$(document).ready(function () { $("#tabs").tabs(); // $(document).on("click", ".btn", function () { // $("#tabs").tabs("select", window.location.hash);\
// $(":file").filestyle({ size: "sm" }); // $(":file").filestyle({ buttonText: "Find file" }); //}); });\
$(document).ready(function () {\
var bar = $('.progress-bar'); var percent = $('.progress-bar'); var status = $('#tabs-2')\
$('form').ajaxForm({ beforeSend: function () { status.empty(); var percentVal = '0%'; bar.width(percentVal) percent.html(percentVal); }, uploadProgress: function (event, position, total, percentComplete) { var percentVal = percentComplete + '%'; bar.width(percentVal) percent.html(percentVal); }, success: function () { var percentVal = '100%'; bar.width(percentVal) percent.html(percentVal); }, complete: function (xhr) { status.html(xhr.responseText); } });\
})(); </script>}\
\
\
\
\

### Reply by Chris Anderson

Hi Niels Albert,\
\
Paste your html in **tabs-2** div instead of **status** div.\
\
var status = $('#status'); // replace this line with \
var status = $('#tabs-2');\
\


---

Original Source: https://www.mindstick.com/forum/2406/screen-is-called-two-times

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
