ASP.NET MVC Dynamic RenderActions in jquery tabs -


OK, so, that title is a mouth ... but, I think that you understand what I do I am trying to

I have a page that has jquery tab controls, and I present various tabs by looping through my model. Now, the divisions (which are "links" on those tabs) are also created with the same loop. So I have the same tab + divisions attached to those tabs.

The problem is that, this is called only the first Render Action, the others are all the same.

The code renders the edge:

  foreach (var domains in model. Model) {%> & Lt;% = string.format (@ "& lt; div id =" "domain_ {0}" "& gt;", domain.ID)%> & Lt;% = Html.Encode (domain.ID)%> & Lt;% Html.RenderAction ("DomainView", "person", new {domainid = domain.ID}); & Gt%; & Lt; / Div & gt; & Lt;%}% & gt;  

Therefore, there is an ID of "domain_NUMBER" in each div, where the number is definitely omitted. And the projection calls the "DomainView" verb in my controller that takes a "domainid" parameter.

Hope this will work, but, I think I am wrong ...

If I understand you correctly, you can say, 3 divs, but they all are the same. By doing the same you can mean 2 things:

1) If you think that all divs have the name "div_1" then you have 3 with the same domain id There are domains and there is a problem in the way you add domain to your model

2) If you mean that the divan is given different name but the content is the same,

< P> You need to set a breakpoint on domainview action with the person controller that will allow you to see that Omenaid is going to be what kind of pass. Because the code itself looks fine. This issue is likely to be done with routing. For example, the DomainView action takes an id parameter, but you are passing DOMAINID, so the ID is the default for 0 only, which means that all divs have the same content


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -