Solved

popup control

Posted on 2009-05-10
12
565 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now