Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ModalPopUpExtender no working.

$
0
0

Ok, I am pretty new to programming in general, and I am very new to ASP.NET/C#.

I spent about 30 minutes making this and then the entire rest of the day trying to make it work.  I've followed guides on websites, the sample website from ajax, and youtube and I have no idea what I am doing wrong.

What I want is to have a popup window appear when a button is pressed so that a user can entire in a few pieces of data and then submit it to a mssql db.  I don't care about the sql coding right now, I just want the popup to appear on the screen when I click the button.

Page Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewTicket.aspx.cs" Inherits="CWTS.viewTicket" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>View</title><link rel="stylesheet" type="text/css" href="Content/Site.css" /><script type="text/javascript" src="Scripts/jquery.min.js"></script><script type="text/javascript" src="Scripts/image_slide.js"></script></head><body><form id="form1" runat="server"><ajaxToolkit:toolkitscriptmanager runat="server"></ajaxToolkit:toolkitscriptmanager><div id="content"><h2>Events:</h2><br />   <asp:Button ID="btnEvent" runat="server" Text="Add Event" OnClick="btnEvent_Click" /><asp:Panel ID="pEvent" runat="server" Style="display: none" CssClass="modalPopup"><asp:Panel ID="Panel1" runat="server" style="border:solid 2px #cccccc; width:98%; cursor: move;">Drag Panel</asp:Panel><div>Test<asp:Button ID="btnEventSubmit" runat="server" Text="Submit" /><asp:Button ID="btnEventCancel" runat="server" Text="Cancel" /></div></asp:Panel><ajaxToolkit:ModalPopupExtender ID="pEventExtender" DropShadow="true" PopupDragHandleControlID="Panel1" runat="server" 
                        BackgroundCssClass="modalBackground" CancelControlID="btnEventCancel" 
                        OkControlID="btnEventSubmit" PopupControlID="pEvent" TargetControlID="btnEvent" />

Codebehind:

        protected void btnEvent_Click(object sender, EventArgs e)
        {
            pEventExtender.Show();
        }

Css:

.modalBackground {
    background-color: gray;
    filter: alpha(opacity=70);
    opacity: 0.7;
}
.modalPopup {
    background-color: #ccc;
    border-width: 3px;
    border-style: solid;
    border-color: gray;
    padding: 3px;
    width: 300px;

   }

This is killing me, because it will look so much nicer to have the pop up instead of going to a second page or having the form built into the page itself.

I get 0 build errors, the panel isn't visible at first, click the button...nothing happens.  No debugging errors when the btn click does nothing.

I know I probably have a single error somewhere, but I am going crazy trying to figure this out.  Is it because of the javascript I have in the head?

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>