469,568 Members | 1,483 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

ModalPopupExtender

I am trying to use ASP.NET Ajax Control Toolkit ModalPopupExtender which
works fine, but what I am trying to do is:

1) User Clicks on the button:
2) Function on the server will check for a status
3) Only display ModalPopupExtender if the status is True.

How do I do that, how do I display ModalPopupExtender only after postback?
Is that possible?
Thank You
Peter

Nov 17 '08 #1
2 3514
Hi Peter,
Is it what you need?

Aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
this.ModalPopupExtender1.Enabled = false;
}

protected void Button1_Click(object sender, EventArgs e)
{
if (true)//condition here
{
this.ModalPopupExtender1.Enabled = true;
}
}

Aspx:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

<asp:Label ID="Label1" runat="server" Text="Click Me After
ModalPopupExtender is Enabled" BackColor="Yellow"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Enable
ModalPopupExtender" onclick="Button1_Click" />
<asp:Panel ID="Panel1" runat="server" style="display:none" >
Hello</asp:Panel>
<cc1:ModalPopupExtender ID="ModalPopupExtender1"
runat="server" PopupControlID="Panel1" TargetControlID="Label1" >
</cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>

Please have a try and let me know if it works. If it's not what you need
please clarify your requirement.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '08 #2
Hi Peter,

Does my code work?

Regards,
Allen Chen
Microsoft Online Community Support

Nov 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by suzi167 | last post: by
reply views Thread by =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post: by
1 post views Thread by Victor | last post: by
reply views Thread by SD | last post: by
1 post views Thread by =?Utf-8?B?S3lsZSBNLiBCdXJucw==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.