Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2010, 05:35 PM
Authorized User
 
Join Date: May 2007
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default login popup on master page

Hi,
I have a website that uses master page. I want a pop up to display so that user has to enter valid user name/psw in order to see pages. There will be only one username/password so web.config will store that info.


Could some one please tell me how to display pop up and check username and password.


thanks
__________________
Cheers
Sheraz
 
Old May 19th, 2010, 06:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Ajax modalpopup control maybe?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old May 19th, 2010, 07:00 PM
Authorized User
 
Join Date: May 2007
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default

i tried but for somereason even when i enter correct username and password the pop up still display again after a flash..

any idea what i am doing wrong?

Quote:

using System;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
LoginStatus1_ModalPopupExtender.Show();
// Popup dialog won't fire if user is already in.
if (Request.IsAuthenticated)
{
LoginStatus1_ModalPopupExtender.Enabled = true;
}
else
{
LoginStatus1_ModalPopupExtender.Enabled = true;
}
}


// When Login button clicked, authenticate user's crendential.
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
// You can add authentication logic here.
e.Authenticated = ((Login1.UserName == "test") && (Login1.Password == "test")) ? true : false;
LoginStatus1_ModalPopupExtender.Hide();

// If login failed, continue showing the popup dialog and failure text.
if (!e.Authenticated)
{
LoginStatus1_ModalPopupExtender.Show();
}
}

// When Cancel button clicked, hide the popup dialog.
protected void btnCancel_Click(object sender, EventArgs e)
{
LoginStatus1_ModalPopupExtender.Show();
}
}

__________________
Cheers
Sheraz
 
Old May 19th, 2010, 09:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

well.. you have show on the cancel button....
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
access child page from Master page Gayathri79 ASP.NET 3.5 Basics 0 March 2nd, 2010 10:36 PM
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.