HI All,
i am Using ASP.Net MVC3
i am using
<a id="SecondarySalesDataTemplate" href="@Url.Content("~/Content/Template/Secondary%20Sales%20Data%20-Template.xlsx")")>
<div class="import" style="float: left">
</div>
Secondary Sales Data - Template
</a> tag
and
@Html.DropDownListFor(x => x.Status, new SelectList(Model.Statuses, "Value", "Text"), new { id = "ddlStatus", onchange = "ddlSelected();" })
Control
in Drobdown list onchange = "ddlSelected();" Event i am trying to set Style="display:block"
using Java script from client side. using this code
initially tha <a></a> Style="display:none" in drobdown selected change event i like to set Style="display:bolck" using java script but below code is not work why.
in java script i am using Switch case based on the selected value of drobdown list value i like to set <a></a> tag style="display:block"
how to do plz explain
<script type="text/javascript">
function ddlSelected() {
debugger;
var ddlVal = $('#ddlStatus').val();
switch (ddlVal.toString()) {
case ("CLAIMPSD"):
var ssdStyle = $('#PrimarySalesDataTemplate');
ssdStyle.style.display = "block";
break;
case ("CLAIMSSD"):
var ssdStyle = $('#SecondarySalesDataTemplate');
alert(ssdStyle);
ssdStyle.style.display = "block";
break;
case ("TenantDistributors"):
var ssdStyle = $('#TenantDistributorsMasterDataTemplate');
ssdStyle.style.display="block";
break;
case ("TenantRetailers"):
var ssdStyle = $('#TenantRetailersMasterDataTemplate');
ssdStyle.style.display="block";
break;
case ("ProductHierarchy"):
var ssdStyle = $('#TenantProductHierarchyTemplate');
ssdStyle.style = "display:block"
break;
case ("ProductMaster"):
var ssdStyle = $('#ProductMasterTemplate');
ssdStyle.style = "display:block"
break;
case ("GeographyMaster"):
var ssdStyle = $('#GeographyMasterTemplate');
ssdStyle.style = "display:block"
break;
case ("GeographyHierarchy"):
var ssdStyle = $('#TenantGeographyHierarchyTemplate');
ssdStyle.style = "display:block"
break;
case ("TargetAchieved"):
var ssdStyle = $('#VolumeAchievedTemplate');
ssdStyle.style = "display:block"
break;
case ("CategoryMaster"):
var ssdStyle = $('#CategoryMasterTemplate');
ssdStyle.style = "display:block"
break;
}
}
</Script>