After invoking the Showmenu() JavaScript function from C# and passing a variable to it, there is a need to utilize this variable in another JavaScript function.
<script type="text/javascript" >
var strmenu;
function ShowMenu(strmenu) {
alert(strmenu);
}
alert(strmenu);
ddsmoothmenu.init({
mainmenuid: strmenu,
orientation: 'h',
classname: 'ddsmoothmenu',
contentsource: "markup")}
</script>
The invocation of ShowMenu(strmenu)
function in C# looks like this:
menu_Sysadmin.Attributes.Add("OnClick", "javascript:return ShowMenu('sysadmin')");
The goal is to use strmenu
from showmenu()
as a parameter in ddsmoothmenu.init()
. While the value is displayed through an alert, attempts to make strmenu
global have been unsuccessful.