My master page contains a menu which is dynamically created in <ul><li><li><ul/>
format.
When I click on it, I want to pass its ID to codebehind for passing it into base class for its permission. But am getting value from jQuery always null in codebehind - but am getting value in jQuery function.
<script type="text/javascript">
$(document).ready(function () {
$('#nav li').click(function () {
debugger;
var vals = $(this).text();
document.getElementById('hdnForLabel').value = vals ;
});
});
</script>
This page load am using in Master Page.
protected void Page_Load(object sender, EventArgs e)
{
GetMenus();
string pageids = hdnForLabel.Value;
BasePage BasePage = new BasePage();
BasePage.LoadSettings(pageids );
}