Show element by checking session in asp.net
Show element by checking session in asp.net
I want to show element (div element) by checking
Session of user It means if User didn't login when Click on the TextArea show Login page with
Here is my code...
<script>
$(document).ready(function () {
$('.form-control').click(function () {
$('.form').show();
return false;
});
});
</script>
///code of textarea
<div class="form-group">
<textarea class="form-control" name="Text" id="Text" rows="5" data-rule="required" placeholder="message" onclick="loginfunction"></textarea>
<input type="hidden" name="Date" id="Date" class="form-control" value="@DateTime.Now" />
<div class="validation"></div>
</div>
////code of login page
<div class="form" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="loginmodal-container">
<h1>Login to Your Account</h1><br>
<form>
<input type="text" name="user" placeholder="Username">
<input type="password" name="pass" placeholder="Password">
<input type="submit" name="login" class="login loginmodal-submit" value="Login">
</form>
<div class="login-help">
<a href="#">Register</a> <a href="#">Forgot Password</a>
</div>
</div>
</div>
</div>
And i put the session in hidden textbox
<input type="hidden" id="cuser2" value="@Session["LoginUSERS1"]" />
I tried to solve this problem with some codes
But Ican't understand this problem
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Please add the complete code for the login page. There is no element with class .form in the code you presented.
– sanfalero
14 hours ago