Hello
Ok, maybe I was not precise enough.
I want to dynamically render an action via renderpartial. But renderpartial does not support to render actions as I understand.
I have this function:
public void AjaxDiv<T>(string id, string title, Expression<Action<T>> detailAction,
Expression<Action<T>> editAction, bool isOpen) where T : Controller, new()
{
And from the Action<T> editAction I want to get the viewdata or better, I want to call the editAction like when I am just opening it directly via link.
And this function is in a separated class library.
In the view it is like this:
<% AjaxBlocks.AjaxDiv<SupplierProductDataController>("supplierData", "Supplier data",
c => c.List(product.Id), false); %>
The target is, that the first time I load the view/controller it renders everything. And then I have an AJAX div which updated via JQuery. Everything with the JQuery works perfect. It is just a problem to load the usercontrol with the first page request directly (via ajax the page load is not that smooth cause every block appears another time).
One problem is, that I want to render this partial view but it is from another controller. With this renderview I can only render partialviews (ascx) from shared folders or from the correct controller which contains the main view. Maybe the old renderaction would have solved my problem.