Solved

Partial postback to stop screen flickr in MVC view

Posted on 2010-09-07
6
1,101 Views
Last Modified: 2013-12-17
I have an mvc view that is made up like wizard navigation.  So view is loaded and when "next button" clicked new data is loaded into view.   I want to stop page flickr so new data is loaded without flickr.  What is best approach.

I am using the same view all the time it is just the data that changes.  So on click of next button I call actionresult post method and return same view with different data.

So I need to know how to stop flickr on view
0
Comment
Question by:ToString1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 19

Expert Comment

by:Bardobrave
ID: 33616979
Maybe you can use AJAX calls to load your server data, they usually are flawless from client point of view and avoid any flicking in the screen.
0
 

Author Comment

by:ToString1
ID: 33617353
I would need an example please
0
 
LVL 19

Accepted Solution

by:
Bardobrave earned 500 total points
ID: 33617405
Ok, lets see...

Supose you have a {controller} which has a {method} that return you the code of a new page of your wizard. Now you're calling your host/controller/method through a postback on a form sit on your form, and this is making your page flicks while data cames from server.

If you use jquery you can substitute your view's form for a button of any type (I usually use links or css styled divs as buttons) and from your client code (on javascript file) use something like that:

/*---- other js code in your page---*/

$("#yourButtonId").click(function () {
   $.post($.url("host/controller/method"),function (htmlResponse) {
     $("#yourDIVContainerId").html(htmlResponse);
   })
});;

/*---- rest of your client code----*/

Here htmlResponse will get the html code that your host/controller/method returns and embed inside your container (I'm assuming here you use a div, but it would be the same whatever your container is).

If you don't use jquery the calls are a bit more complex, as you will need to create an XMLHttpObject and make the call and success callback directly through it's methods.
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 

Author Comment

by:ToString1
ID: 33617790
ok thanks

Currently my actionresult signature is like this

public ActionResult SubmitThis(int ID, List<FOO> Foos)
{
}

So what would I need to do ?
0
 
LVL 19

Assisted Solution

by:Bardobrave
Bardobrave earned 500 total points
ID: 33618476
SubmitThis is your "method", and it would be inside a "controller", the problem you'll find is that you pass to your method a complex structure like List<FOO>, here you have two options:

1) You can simplify your method to receive something you can pass it through client code.

2) You can call through AJAX to a different method who builds your ID and Foos variables and calls back to SubmitThis.
0
 

Author Comment

by:ToString1
ID: 33631957
Thanks for your comments;  I will look into these and award points tomorrow
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question