Solved

popup control

Posted on 2009-05-10
12
567 Views
Last Modified: 2013-11-08
0
Comment
Question by:KaranGupta
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

832 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