hello i am new in asp.net and working on my first project and facing problem on modalpopupextender.

My thread-

When ever i set the properties of modalpopupextender it goes invisible from my design page.

when i debug the project and click on link button it shows nothing .

I need modalpopup extender for login but it is not working . I am using it on my Master Page.

Please help me

Thanks in advance....

Recommended Answers

All 11 Replies

Post what you have so far, so we can correct it or add what you are missing...

Post what you have so far, so we can correct it or add what you are missing...

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
    
    
    <asp:Panel ID="Panel1" runat="server">
    <div style="font-family: Andalus; font-size: x-large; color: #000000">Login</div>
        Email-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        Password-<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Login" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" Text="Cancel" />
     
    </asp:Panel>
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
        CancelControlID="Button2" OkControlID="Button1" onokscript="onOk()" 
        PopupControlID="Panel1" TargetControlID="LinkButton1">
    </asp:ModalPopupExtender>
    
</asp:Content>

Whenever i set the popupControlId ModalPopupExtender goes invisible from my Design Page..

Your code looks fine. try adding some css styling to the panel and the modal

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .modalbg
        {
            background-color: #303030;
            filter: alpha(opacity=80);
            opacity: 0.8;
        }
        
        
        .modalpopup
        {
            padding: 20px;
            position: absolute;
            left: -2000px;
            -moz-border-radius: 5px;
            border: solid 10px #333;
            max-width: 500px;
            box-shadow: 0px 0px 20px #333;
            width: 300px;
            margin: auto;
            background-color: white;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
    <asp:Panel ID="Panel1" runat="server" CssClass="modalpopup">
        <div style="font-family: Andalus; font-size: x-large; color: #000000">
            Login</div>
        Email-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        Password-<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Login" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" Text="Cancel" />
    </asp:Panel>
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="Button2" OkControlID="Button1" OnOkScript="onOk()" PopupControlID="Panel1" TargetControlID="LinkButton1" BackgroundCssClass="modalbg">
    </asp:ModalPopupExtender>
</asp:Content>

i tried but not working for me..

i think the problem is in targetcontrolid whenever i set it,The modalPopupExtender goes invisible from my design page and on debug it does not show any error

i tried o lot...

plz help me i am really in trouble..

I copied your code, into a project that I'm working right now, and it worked right away.

You should check the version of the AjaxControlToolkit, mine is :3.0.30930.28736

So what should i do should i reinstall my ajaxtoolkit or any thing else

but this problem is only with the ModalPopupExtender i am using ValidatorCalloutExtender
also in my project it is working fine..

I know that in some revisions of the Ajax Toolkit there are some problems with some controls, so just double check the version that you have, and post it back.

Got the solution............
yappppiiii..

i just replace the ScriptManager from ToolkitScriptManager and my control is working fine...

.
.
.
.
thanx to all for your replies....

Good to know :)...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.