loading an asp after starting a session
- by Noam Smadja
the jQuery
$("#loginform").submit(function(){
$.ajax({
type: "POST",
url: "loginrespajax.asp",
data: $("#loginform").serialize(),
success: function(){
$("#loginform").hide("slow");
$("#loginform").load("userheader.asp");
$("#loginform").show("slow");
}
});
});
thats userheader.asp
<div class="userlinks">
<%if (session("userlevel")) then%>
<% select case session("userlevel")
case 1 %>
<a href="managenews.asp"><%langstring("header_news")%></a> |
<a href="managebooks.asp"><%langstring("header_books")%></a> |
<a href="manageusers.asp"><%langstring("manage_users")%></a> |
<a href="manageorders.asp"><%langstring("manage_orders")%></a> |
<a href="managelanguage.asp"><%langstring("manage_language")%></a> |
<a href="youthregistration.asp"><%langstring("youthreg_header")%></a> |
<a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> |
<% case 2 %>
<a href="managenews.asp"><%langstring("header_news")%></a> |
<a href="managebooks.asp"><%langstring("header_books")%></a> |
<a href="youthregistration.asp"><%langstring("youthreg_header")%></a> |
<a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> |
<% case 3 %>
<a href="youthregistration.asp"><%langstring("youthreg_header")%></a> |
<a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> |
<% End select %>
<a href="editprofile.asp"><%langstring("editprofile_header")%></a> |
<a href="changepassword.asp"><%langstring("changepassword_header")%></a> |
<a href="logout.asp"><%langstring("logout_header")%></a>
<%else%>
<form action="loginrespajax.asp" method="POST" name="loginform" id="loginform" class="loginform" onSubmit="return false;">
<input type="text" name="username" value="username" class="input inline" onFocus="clearText(this);">
<input type="password" name="password" value="password" class="input inline" onFocus="clearText(this);">
<input type="submit" value="Log In" class="submit inline">
</form>
<%End if%>
</div>
i am submiting the login form using AJAX and the jQuery partially works. it does hide and show again. but it prints the ELSE part of in userheader.asp.
the session does start, for sure :)