Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have created a custom LogIn UserControl(ascx) in asp.net
and placed it to aspx Content Page (this is inherited from Master Page).

What I want to do :
There is a ASP Button on my UserControl and a Link Button on aspx page. When I click on Link Button, UserControl is showing as a POP-UP using Ajax Modal Pop-Up. Now problem is that for every un-successful LogIn (by checking UserId & Password in Database), Pop-Up is disappeared & the aspx page is showing. But it should not be.

How can I display an error message in the same pop-up window for every un-successful LogIn ?
Please share the code (if possible).

Thanks in advance .....
Posted
Comments
Dholakiya Ankit 26-Jul-13 0:24am    
solution 1 is ok fr u

1 solution

Yes, for every postback modalpopup will disappear. You need to show it from back-end. In your case you should show the popup if login is not successful. Try this:
C#
if(loginSuccessfull)
{
   //Write your code here to go to home page.
}
else
{
    //Show the modal popup extender
    ModalPopupExtender1.Show();
}



--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900