Question

ModalPopUpExtender and the Asp.net LoginView\Login Control not working properly

Asked by: Perfectdeception

Hello all. This is my first post so I hope that I provide all the necessary information:

Problem:
I have an login control on my home page that when the login button is selected, programmtically I am authenticating the user and also determing wether to display a hidden mulitview.  The criteria for showing the mulitview is this:  If the user is missing some security question, then show the appropropriate view, same if they user is missing an email, or if the user is missing both Email and Security.

I have the mulitview wraped up in a <asp:panel> control
I have the <ajaxToolkit:ModalPopupExtender> on the page
TargetControlID="ctl00$cphContent$LoginView1$LoginControl$LoginImageButton" is the login controls login button.  FYI the TargetControlID is the asp.net generated name for the login controls button.
Of course I have the <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" /> on the page as well.

With this setup I am getting some really weird results or lack there off.

My page comes up fine with the login control. I put in an ID and Password to test, then click on the login button.  At this point my login control basically freezes, not the whole page but just that control.  Meaning I cant click back into the user name text box or the Password text box.  I cant select the login button.  Also the site does not log the user in either.  I just sits there with no status in the status bar or anything.  

I am unsure what is causing this behavior.

I am really just trying to get the page to do what they are doing here: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx

Attached is the code, any help would be appreciated

<asp:Panel ID="Panel1" runat="server">
		<div id="divPopupWindow" class="PopupDivWindow" visible="false" runat="server">
			<div class="PopupDivWindow-Container">
				<div class="PopupDivWindow-Title">
					<a href="javascript:showHide('ctl00_cphContent_divPopupWindow')"><img src="/images/btn-CloseWindow.gif" alt="Close" border="0" class="PopupDivWindow-Controls"/></a>
				</div>
				<div class="PopupDivWindow-Content">
					<asp:MultiView ID="mvPopupWindow" runat="server" Visible="false">
						<asp:View ID="viewNoEmail" runat="server">
							We have no email address for you on file. 
							<br />
							<br />
							<asp:HyperLink ID="lnkAddEmail" runat="server" NavigateUrl="~/Encrypt.aspx?url=agentInfo/agentInfo.asp" Target="_blank" Text="Click Here" />
							to update your information.
							<br />
							<br />
							<a href="javascript:showHide('ctl00_cphContent_divPopupWindow')">No remind me later.</a>
						</asp:View>
						<asp:View ID="viewNoQuestions" runat="server">
							Crump has enhanced it's security features to better protect you.  
							<br />
							<br />
							<asp:HyperLink ID="lnkManageQuestions" runat="server" NavigateUrl="~/MyAccount/ManageQuestions.aspx" Text="Click Here" />
							 to answer your personal security questions.
							<br />
							<br />
							<a href="javascript:showHide('ctl00_cphContent_divPopupWindow')">No remind me later.</a>
						</asp:View>
						<asp:View ID="viewNoEmailAndQuestions" runat="server">
							Crump has enhanced it's security features to better protect you. 
							<br />
							<br />
							<asp:HyperLink ID="lnkManageEmailAndQuestions" runat="server" NavigateUrl="~/MyAccount/ManageQuestions.aspx" Text="Click Here" />
							 to answer your personal security questions and update your email address.
							<br />
							<br />
							<a href="javascript:showHide('ctl00_cphContent_divPopupWindow')">No remind me later.</a>
						</asp:View>
					</asp:MultiView>
				</div>
			</div>
		</div>
		</asp:Panel>
		<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" 
            TargetControlID="ctl00$cphContent$LoginView1$LoginControl$LoginImageButton"
            PopupControlID="Panel1"              
            DropShadow="true" />
 
<asp:LoginView ID="LoginView1" runat="server">
			<AnonymousTemplate>
			    <div class="Header">Login to Crump Life Insurance</div>
				<div class="LoginControl">
					<asp:Login ID="LoginControl" runat="server" onloggedin="LoginControl_LoggedIn" >
						<LayoutTemplate>
						    <br />
							<table cellspacing="0" cellpadding="0" border="0" style="width: auto;">
								<tr>
									<td>
										User Name
									</td>
									<td>
										<asp:TextBox ID="UserName" runat="server" />
									</td>
									<td>
									    <asp:RequiredFieldValidator ID="UserNameRequired" Display="static" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login" Text="*" />
									</td>
								</tr>
								<tr>
									<td>
										Password
									</td>
									<td>
										<asp:TextBox ID="Password" runat="server" TextMode="Password" />
									</td>
									<td>
									    <asp:RequiredFieldValidator ID="PasswordRequired" Display="static" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login" Text="*" />
									</td>
								</tr>
								<tr>
									<td colspan="2" >
										<table cellspacing="0" cellpadding="0" border="0" style="width: 100%">
											<tr>
												<td>
													<asp:CheckBox ID="RememberMe" runat="server" Text="Remember Me" />
												</td>
												<td style="text-align: right;" >
													<asp:ImageButton ID="LoginImageButton" CssClass="Button" runat="server" AlternateText="Log In" CommandName="Login" style="height: 25px" ImageUrl="~/Images/logon-button.gif" ValidationGroup="Login" />
												</td>
											</tr>
										</table>
									</td>
									<td>
									</td>
								</tr>
								<tr>
									<td colspan="2" class="error" style="white-space:normal; text-align: center;">
										<asp:Literal ID="FailureText" runat="server" EnableViewState="False" />
									</td>
								</tr>
								<tr>
								    <td colspan="2" style="text-align: right;">
								        <a href="/MyAccount/UserNameRecovery.aspx" >Forgot User Name</a><br />
								        <a href="/MyAccount/PasswordRecovery.aspx" >Forgot Password</a><br />
								    </td>
								    <td></td>
								</tr>
							</table>
						</LayoutTemplate>
					</asp:Login>
				</div>
			</AnonymousTemplate>
			<LoggedInTemplate>
				<div class="Header">Welcome <asp:Label ID="lblDisplayName" runat="server" /></div>
				<div class="CaseControlCenter-Navigation">
				   <ul>
				      <asp:LoginView ID="lvCaseStatus" runat="server"><RoleGroups><asp:RoleGroup Roles="CaseStatus.ReportType.Agent,CaseStatus.ReportType.Manager,CaseStatus.ReportType.Coordinator,CaseStatus.ReportType.Organization,CaseStatus.ReportType.SalesManager,CaseStatus.ReportType.Classification"><ContentTemplate>
					    <li><a href="/CaseStatus/List.aspx"><span><img src="images/ccIcon-CaseStatus.png" alt="Case Status" width="37" height="16" class="ccIcon" />Case Status</span></a></li>
					  </ContentTemplate></asp:RoleGroup></RoleGroups></asp:LoginView>
					  <asp:LoginView ID="lvCommissions" runat="server"><RoleGroups><asp:RoleGroup Roles="ViewCommissions"><ContentTemplate>
					    <li><a href="/Encrypt.aspx?url=commissions/menu.asp" target="_blank"><span><img src="images/ccIcon-Commissions.png" alt="Commissions" width="16" height="15" class="ccIcon" />Commissions</span></a></li>
					  </ContentTemplate></asp:RoleGroup></RoleGroups></asp:LoginView>						  						  
					  <li><a href="MyAccount/MyAccount.aspx"><span><img src="images/ccIcon-MyAccount.png" alt="My Account" width="12" height="16" class="ccIcon" />My Account</span></a></li>
					  <%--<li><span><img src="images/ccIcon-Search.png" alt="Search" width="16" height="16" class="ccIcon" />Search <input type="text" name="Search" id="Search" /></span></li>--%>
					</ul>
				</div>                
			</LoggedInTemplate>
		</asp:LoginView>

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-06-02 at 14:17:39ID23451349
Tags

C#

,

login

,

asp.net

,

control

,

modalpopupextender

Topics

WebApplications

,

Programming for ASP.NET

,

C# Programming Language

Participating Experts
1
Points
500
Comments
12

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. ctl00_ (control ID problem)
    why does asp.net include ctl00_ in front of my ID's on some pages, but not on others? it's messing up my ID's and i can not use them :( any idea?
  2. ASP.NET and AJAX
    Hi, Can anyone please explaine me about the use of AJAX in web application development? Why should I use this AJAX and what are the benefits of using that? How does it related to ASP or ASP.NET?
  3. JSON and AJAX ASP.NET
    I hear the JSON is the way to serialize with asp.net these days and so I am trying to use the AJAX tookit and send JSON. I have installed a tool from : http://projects.nikhilk.net/WebDevHelper/Default.aspx It does not seem to indicate that I have been serializing with JSON....
  4. Ajax in ASP.NET
    Hi all, I am using ASP.NET 2.0 in my web application. 1. I want to use ajax how do I do i do that. What are the steps. 2. I have forms which I need to apply ajax fucntionality. Like a.I have search form for where I show results in datagridview. So I ping the database ev...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sjors1309Posted on 2008-06-02 at 15:05:26ID: 21696090

Try not using a client side name for TargetControlID in asp markup (server code). Just state the controlname (serverside) of the control that you want to associate the extender with being just LoginImageButton and let ASP.Net create the correct names for you

 

by: PerfectdeceptionPosted on 2008-06-02 at 15:11:32ID: 21696129

Thanks, but I have tried that.  When I use the actual name of the submit button in the login control, I get an error: The TargetControlID of 'ModalPopupExtender' is not valid. A control with ID 'LoginImageButton' could not be found.

In other words the ModalPopupExtender cant even see the login button inside the login control.

 

by: sjors1309Posted on 2008-06-02 at 15:22:40ID: 21696191

Have you tried moving the ModalPopup markup to the LoginView template that contains the button?

 

by: PerfectdeceptionPosted on 2008-06-02 at 15:28:50ID: 21696236

I had not, but at your suggestion just did.  I dont get the error indicating that the modalPopupExtender doesnt see the contol anymore, but the original problem still persists.  When selecting the login controls login button my site does nothing.  The login button doesnt seem to want to work.  I am not sure why setting a TargetControlId would make the actual button stop working?

Is there a way to see where the hang up is occuring?

 

by: sjors1309Posted on 2008-06-02 at 15:48:35ID: 21696346

Well it's popping a modal window that should be closed first before anything other that the controls on the modal popup can be accessed.
So this behaviour is by design. Do you see your modal popup window when clicking on the button?

 

by: PerfectdeceptionPosted on 2008-06-02 at 15:56:11ID: 21696402

I am not exactly sure what you are saying in your first sentence.  The second remark, no nothing is happening at all when clicking the button including authentication.

 

by: sjors1309Posted on 2008-06-02 at 16:06:39ID: 21696486

The purpose of a modelpopupextender is to pop a window when a user clicks on a button (in your case).
This popup is modal, that means it's in the front and all that's in the background cannot get focus anymore.
I suspect that your app is doing what it should, it pops the panel that is referenced in the ModalPopupExtender and by doing that makes selecting anything else on the page impossible.
You can't see this popup, so it seems the app is frozen.
Try removing the visible = false on div id "divPopupWindow" and see what happens

 

by: PerfectdeceptionPosted on 2008-06-03 at 06:39:05ID: 21700246

Ok, so I removed the Visable="false" and the results where a little different,but it seems that know the problem is a little different.

The multiview that is encapsulated in the div does come up when I click the login button, however there is no text present in the view.  Also when I close the div I am still not continuing on with my authentication.

By the way thank you for your help1

 

by: PerfectdeceptionPosted on 2008-06-03 at 07:44:57ID: 21700893

Oh yeah, also the back ground is not graying out

 

by: sjors1309Posted on 2008-06-03 at 13:12:59ID: 21704073

The modal popup eats away all clicks to other page elements. It's activated by a user clicking the login button.
You need to define a function to close the modalpopup (see http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx) and maybe some javascript to cause a postback after you did something in the modal popup.
The background not graying out is b/c you probably didn't confiure it to do so. It's done through CSS and you need to add this style to your modalpopup yourself. It isn't generated automatically for you. See beforementioned URL for examples.

It's all in de the popup. I created the page you posted. Got rid of the MultiView and tested it. Behaviour is the same.

 

by: PerfectdeceptionPosted on 2008-06-03 at 13:30:49ID: 21704250

I see.  Well scope of my homepage just changed so that just changed how I will be displaying this pop up.  I will not have to worry about the login button anymore because we are going to require authentication before I even get to the area of my site that is requiring the pop up check.  So know I have to wait for that change to take place.

I have been to the site you gave the link to(where I got the idea to use this). sounds like I need to do some more research into exactly how to use this control.

Your help was very valuable, and will have to be used at a later date.

 

by: PerfectdeceptionPosted on 2008-06-03 at 13:31:41ID: 31463373

Thanks again!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...