Jquery Accordian with asp.net mvc3

Posted by Johnseelan under jQuery on 11/9/2011 | Points: 10 | Views : 2362 | Status : [Member] | Replies : 0
Hi Friends,

i was using Jquery Accordian with asp.net mvc3
inside the Accordian i was using some div's. & one buttons.
when i click the button" id="@frmId-btnNew"" i need to expand the 2nd div of accordian the first one is i need to set collapse.

this is the sample code.

<div id="details">
<div>
<div class="NewButton">
<input type="button" class="formButton" id="@frmId-btnNew" onclick="showCustomer(this);" formId="@frmId" value="@(captions.ContainsKey(ResourceConstants.CUSTOMER_NEWBTNTEXT) ? captions[ResourceConstants.CUSTOMER_NEWBTNTEXT] : string.Empty)"/>
@*<input type="image" src="../../Content/themes/images/add_icon.gif" id="@frmId-btn-0" onclick="ShowNextAddess(0);" />*@
</div>
</div>
<div id="@frmId-Accordion1" class="Accordion">
@for (int i = 0; i < Model.CustomerAddresses.Count(); i++)
{
<div class="AccordionPanel panel-@i">
@if (Model.CustomerAddresses[i].AddressTypeId == ViewBag.StreetCodeId)
{
<div class="AccordionPanelTab">
@(captions.ContainsKey(ResourceConstants.CUSTOMER_ADRESSLEGEND) ? captions[ResourceConstants.CUSTOMER_ADRESSLEGEND] : string.Empty)
</div>
}
else
{
<div class="AccordionPanelTab">
@(captions.ContainsKey(ResourceConstants.CUSTOMER_ADDITIONALADDRESS) ? captions[ResourceConstants.CUSTOMER_ADDITIONALADDRESS] : string.Empty)
</div>
}
<div class="AccordionPanelContent">
<div id="customerPartialView-@i">
@{ViewBag.Id = i;}
@{Model.CustomerAddresses[i].MetadataAttributes = Model.MetadataAttributes;}
@Html.Partial("EditPartial", Model.CustomerAddresses[i])
</div>
</div>
</div>
}
@for (int j = Model.CustomerAddresses.Count(); j < ViewBag.AddressCount; j++)
{
<div class="AccordionPanel panel-@j hide">
<div class="AccordionPanelTab">
@(captions.ContainsKey(ResourceConstants.CUSTOMER_ADDITIONALADDRESS) ? captions[ResourceConstants.CUSTOMER_ADDITIONALADDRESS] : string.Empty)
</div>
<div class="AccordionPanelContent">
<div id="customerPartialView-@j">
</div>
</div>
</div>
}
</div>
<div>
@if (Model.ExtensionAttributes != null && Model.ExtensionAttributes.Count() > 0)
{
@Html.Partial("ExtendedPartial", Model)
}
</div>
</div>


function showCustomer(d) {
inside this methos i want to achive
please any one help me

}
i was try useing some example i i cant achive please any one help me.




Responses

(No response found.)

Login to post response