Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Iframe postback causing MVC method to reload everything

$
0
0

Is it possible to catch a postback in MVC method? Because every time my iframe postbacks, it does all my codes in my MVC method, such as getting data from the database; this is expensive.

in my html

<IFrame name="iframeReport" src="~/MVCController/MyMethod?param1=value1&param2=value2"/>

MVCController.cs

public class MVCController: Controller
{
    public ActionResult MyMethod(string param1, string param2)
    {
        // some codes here getting data from database
        return View(new MyModel(data));
    }
}

is it possible to know if it is a postback? some thing like this:

public class MVCController: Controller
{
    public ActionResult MyMethod(string param1, string param2)
    {
        If(!isPostback)
        {
           // some codes here getting data from database
        }
        return View(new MyModel(data));
    }
}


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>