public ActionResult Start() { var taskId = Guid.NewGuid(); tasks.Add(taskId, 0); Task.Factory.StartNew(() => { for (var i = 0; i <= 100; i++) { tasks[taskId] = i; // update task progress Thread.Sleep(50); // simulate long running operation } tasks.Remove(taskId); }); return Json(taskId); }
Monday, July 30, 2012
ASP.NET MVC 3: Async jQuery progress indicator for long running tasks
http://blog.janjonas.net/2012-01-02/asp_net-mvc_3-async-jquery-progress-indicator-long-running-tasks
Friday, July 27, 2012
How to make A link to submit a form?
<form>
<a href="#" onclick="parentNode.submit();">Submit</a>
</form>
<a href="#" onclick="parentNode.submit();">Submit</a>
</form>
Thursday, July 26, 2012
How to display an image from memory in ASP.NET MVC3
In controller:
public ActionResult MyImage()
{
byte[] image = .....;
return File(image, "image/png");
}
In view:
<img src="@Url.Action("MyImage", "ControllerName")" alt="my image" />
http://rayaspnet.blogspot.ca/2012/06/how-to-covert-string-to-image-in-mvc.html
public ActionResult MyImage()
{
byte[] image = .....;
return File(image, "image/png");
}
In view:
<img src="@Url.Action("MyImage", "ControllerName")" alt="my image" />
http://rayaspnet.blogspot.ca/2012/06/how-to-covert-string-to-image-in-mvc.html
Subscribe to:
Posts (Atom)