Я хочу получить сессию в jQuery (v 1.9.1).Получить вопрос сеанса
Я использовал следующий код:
<script>
var testUser = '<%= Session["User"] %>';
alert(testUser);
</script>
Но я получаю следующее сообщение об ошибке:
"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
"Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)"
Аналогичный вопрос обсуждался здесь: http://stackoverflow.com/questions/778952/the-controls-collection-cannot-be-modified-because-the-control-contains-code-bl – Riv
Tanks.I add 'Page. Header.DataBind() в aspx и отлично работает :). – ZSH