initially tha <a></a> Style="Display:none" in drobdown selected change event i like to set Style="di

Posted by Johnseelan under Regular Expressions on 6/30/2011 | Points: 10 | Views : 2288 | Status : [Member] | Replies : 11
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>




Responses

Posted by: Ndebata on: 6/30/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
You can write like this
ssdStyle.style.cssText ="display:none";


Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neha-kapoor on: 6/30/2011 [Member] Starter | Points: 25

Up
0
Down
hallo narayan
pls check my attachment on this
i want to show selcted data in textbox from datalist
pls check
 Download source file

thanks

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/30/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Neha,
I have made small changes in your code and attached it in one of your previous post.
http://www.dotnetfunda.com/forums/thread5226-how-can-show-data-in-textbox-select-the-datalist.aspx
Thanks,
Narayan

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neha-kapoor on: 6/30/2011 [Member] Starter | Points: 25

Up
0
Down
thanks sir
dear sir if i want to show the data on next page
like
if user click the asp.net link then redirect the page next page and show ID and Cat_type
in a lable,how can i do this can you help me plssssssssssssssssssssssssssssssss

thanks

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnseelan on: 7/1/2011 [Member] Starter | Points: 25

Up
0
Down
Sorry Ji it is not working
"ssdStyle.style.cssText ="display:none";"

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 7/1/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
Set it to block, in case you are going to show it.
ssdStyle.style.cssText ="display:block";


Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CS1401 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Dont tell to do your work to others. This is not a right place to do your personal works. If you have doubt means only ask politely.
Thanks.

...

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnseelan on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
u see that is my doubt,
here i am asking my doubt only,

thanks
john

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnseelan on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
u see that is my doubt,
here i am asking my doubt only,

thanks
john

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CS1401 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Sorry John i didnt mean you. I before told about neha-kapoor user. anyway sorry.

...

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnseelan on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
ITS OK CS1401, No problems.
Thanks
John

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response