login page in asp.net - asp.net

hii i am new to web site development
there is a login page in my web site which is in ASP.net(C#.net) . After entering the username and password and user click on the Login button . The user name and password got check and it shows the message at the "the user name and password did'nt match" but i want this messageas a message box. Currently it is showing as a line on the left-top corner of the page..
if possible so please give the code

You would have to put code in the LoginFailed event handler for the login control (if you are using the .NET framework login control, if not, proceed below). The login control's template also has an error label that you would have to inspect the control's children for to hide since you don't want that to display. In LoginFailed, or if you have your own UI login form, you can write out a message to display via:
Page.ClientScript.RegisterStartupScript(this, "error", "alert('The user name and password could not be verified');");

You will have to draw your own message box using HTML formatting (maybe a formatted div element), or use javascript's alert box to do so if you're shooting for a quick solution.
alert('Error','The Username and Password didn\'t match.');
ASP.net outputs HTML to the browser, so if you don't have formatting then the message will simply appear unformatted on the page.

Related

user input link will go back to login once the user logged in it will go to the link earlier input instead of dashboard

Sorry to ask but I don't what is the exact call on this.
I have a scenario for example I paste this link localhost/Dashboard/Treatment the user will go back to the login page once the user logged it will go to this localhost/Dashboard/Treatment instead of Main Page using asp.net.
I need is only the exactly the call on this process so that I will do the research.
Sorry beginner :)
If you are using login control, you can use DestinationPageUrl property in your code.
If you just use things like text boxes and button controls, then in your Button_Click event, you can just use Response.Redirect("DestinationHere").
If you don't want change anything in your page, you can add return RedirectToAction({actionName}, {controllerName}); in your login method.

Using a separate submit button on a "Change Password" Web UI Control?

Intro:
I should start by saying I am not an ASPX developer. I mainly do PHP and C# on the windows side. I know enough to get me by.
We have a developer currently working on a web system for a client. A part of the system is where users go to change their profile details. (Name, telephone number etc)..
What we currently have:
He had put the "Change Password" on a separate page that is linked from the profile page. This is using the ChangePassword control. I have moved this onto the same page as the other fields, but only works with the included submit button with the control.
What we would like to do:
We would prefer that we could use the "Save" button at the bottom of the page that saves all the settings, rather than have a separate "Change Password" button.
I have looked online for a solution but seems that no one has done this with the control before. I can't find any documentation on how to do this. Is it possible?
Place textboxes for Current Password and New Password in your page rather than using change password web control and then call the built-in asp.net membership method to change password
System.Web.Security.MembershipUser.ChangePassword(txtCurrentPwd.Text, txtNewPwd.Text);

Remember login from WordPress password protected page

I know how to password protect a page and check if it has been entered with post_password_required. What I need to know is if I can then continue to know if a user has logged into this password protected page even after leaving it. The reason for this is because I would like to display a site wide navigational sidebar that allows the user to get back to that page, but only have it show if they have logged into that page earlier.
Set a session variable if they login successively to the given page, then when they are on another page later, have the sidebar echo the link if that session var is set.
The value of the session var can be the url to create the link, if you have more than one page you're trying to do this with.

asp.net redirection defect

I am working on asp.net application.the user is clicks on some link which is inside grid item template field. if he is not logged in then he redirects to login page. after log in he is properly coming back to same page;the problem is that "i have passed the value in querystring to the page where he click on the link and after loggedIn the grid is showing blank because that grid is not getting query string value" I think you understand my problem.plz share your helpful opinion.
http://www.aspdotnetfaq.com/Faq/what-is-the-difference-between-server-transfer-and-response-redirect-methods.aspx
It is not a defect, but the desired behavior of Response.Redirect.
Store value in session and retrieve it after he gets back successfully from the login page.

Add an image to browser enabled infopath form

Instead of digitally signing a form, is it possible for users to attach an image with their signature to the form in InfoPath 2007. The other users who are viewing the form should also be able to view the image and not as an attachment.
Form is browser enabled!
Use a picture control and select "Included in the form" on the popup (instead of "as a link") and anything the user selects will show up directly in the form.
Note that using this as a signature does NOT ensure integrity/security. Any other user can remove that "signature" image and put their own (or put someone elses "signature" image in).

Resources