Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

popup control

Posted on 2009-05-10
12
Medium Priority
?
583 Views
Last Modified: 2013-11-08
0
Comment
Question by:KaranGupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 9

Expert Comment

by:tetorvik
ID: 24351521
You can use popupControl.Show(); or popupControl.Hide(); to control popup control visibility on server-side. You can do the same with javascript with popupControl.show(); or popupControl.hide();
0
 

Author Comment

by:KaranGupta
ID: 24351643
Hi

I have used following code(code in code section)

But I didn't see anything like

Show() or Hide() in code behind
<asp:TextBox ID="txtDatabaseEntry" runat="server"></asp:TextBox>    
    <asp:Panel ID="loginPanel" runat="server" Style="display: none">
        <asp:Login ID="LoginCtrl" runat="server" FailureText="Identifiant incorrect ! Essayez ? nouveau..."
            LoginButtonText="Login" PasswordLabelText="Password" PasswordRequiredErrorMessage="Le mot de passe est requis."
            RememberMeText="Remember Me" TitleText="S'identifier"
            UserNameLabelText="User Name" UserNameRequiredErrorMessage="L'email est requis."
            CreateUserText="S'enregistrer" CreateUserUrl="/Register.aspx" PasswordRecoveryText="Mot de passe oubli? ?"
            PasswordRecoveryUrl="/PasswordRecovery.aspx" />
    </asp:Panel>
    <ajaxToolkit:PopupControlExtender ID="PopEx" runat="server" TargetControlID="txtDatabaseEntry"
        PopupControlID="loginPanel" Position="Left" />

Open in new window

0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24351684
If there is no specifig condition to check prior opening/closing the popup you can use:

TargetControlID - The ID of the element that activates the modal popup  (for example login loginHyperLink like in your example)
CancelControlID - The ID of the element that cancels the modal popup



<ajaxToolkit:PopupControlExtender ID="PopEx" runat="server" TargetControlID="loginHyperLink"
        PopupControlID="loginPanel" Position="Left" CancelControlID="cancelButton" />

Open in new window

0
PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

 
LVL 9

Expert Comment

by:tetorvik
ID: 24351698
PopEx.Show(); and PopEx.Hide(); should exits on you page / user control that contains the PopupControlExtender control .
0
 

Author Comment

by:KaranGupta
ID: 24351933
Hi

It is necessary to put popup extender in the <asp:updatepanel

because I am getting an error

"The control with ID 'PopEx' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
"
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24352028
To enable ASP.NET Ajax in general on your page you'll need to have <asp:ScriptManager ID="ScriptManager1" runat="server" /> on your page.
You can use popup control without updatepanel, but the scriptmanager is required.
0
 

Author Comment

by:KaranGupta
ID: 24352054
Hi

I have used script manager now it is working

but still I don't find show method

can you help me with that
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24352112
Can you  post your aspx and aspx.cs file?
Do you see your PopEx in code-behind at all?
0
 

Author Comment

by:KaranGupta
ID: 24352274
Hi

It is working fine now

by using Modalpopup extender

but when the modal popupextender opens
I can still click on the buttons of the webpage behind the pop up control

Is there any way to disable them
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24352308
it should be modal by default. are you using frames?
0
 

Author Comment

by:KaranGupta
ID: 24352316
No I am not using frames

Can we disable the Previous background

0
 
LVL 9

Accepted Solution

by:
tetorvik earned 2000 total points
ID: 24352372
the main screen should be grayed by default. see the sample from http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx
once clicking the link "Click here to change the paragraph style" it opens a modal popup and there is no way to click other screen elements before the modal dialog is closed.

You can also download ajax control toolkit with source code and samples (http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=16488).  There you can see for example how the link above is implemented.  
0

Featured Post

Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question