get user id

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

using javascript, how do you get the user id of whose logged in currently?

thanks,
rodchar
 
You can put the "userId" to the hidden input control and get it using
javascript.

<body>
<form id="form1" runat="server">
<div>
<input id="Hidden1" type="hidden" value="<%=
HttpContext.Current.User.Identity.Name %>" /></div>

<script type="text/javascript">
alert(form1.Hidden1.value);
</script>
</form>
</body>

Alexey Borzenkov (http://aspspider.net/snake)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top