WanaBRich
asked on
How do I access the ModalPopupExtender that lives on the MasterPage from a content Page?
The first part of the code lives in the master page.
The second one lives on a content page that I want the modelpopup to appear on.
My thought is that I can use mpeNewCustomer.Show(); to invoke it but not sure this will work yet;
The second one lives on a content page that I want the modelpopup to appear on.
My thought is that I can use mpeNewCustomer.Show(); to invoke it but not sure this will work yet;
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" >
<asp:Panel ID="pnlNewCustomer" runat="server" Style="display: none">
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
DataKeyNames="CustomerID" DefaultMode="Insert" DataSourceID="ldsCustomer" Height="50px"
Width="125px">
<Fields>
<asp:BoundField DataField="SecurityID" HeaderText="SecurityID"
SortExpression="SecurityID" />
<asp:BoundField DataField="CustomerCompanyName"
HeaderText="CustomerCompanyName" SortExpression="CustomerCompanyName" />
<asp:BoundField DataField="CustomerAddress" HeaderText="CustomerAddress"
SortExpression="CustomerAddress" />
<asp:BoundField DataField="CustomerCity" HeaderText="CustomerCity"
SortExpression="CustomerCity" />
<asp:BoundField DataField="CustomerState" HeaderText="CustomerState"
SortExpression="CustomerState" />
<asp:BoundField DataField="CustomerZip" HeaderText="CustomerZip"
SortExpression="CustomerZip" />
<asp:BoundField DataField="CustomerPhone" HeaderText="CustomerPhone"
SortExpression="CustomerPhone" />
<asp:BoundField DataField="CustomerContactName"
HeaderText="CustomerContactName" SortExpression="CustomerContactName" />
<asp:BoundField DataField="CustomerContactEMail"
HeaderText="CustomerContactEMail" SortExpression="CustomerContactEMail" />
<asp:CheckBoxField DataField="CustomerIsActive" HeaderText="CustomerIsActive"
SortExpression="CustomerIsActive" />
<asp:CommandField ButtonType="Button" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:LinqDataSource ID="ldsCustomer" runat="server"
ContextTypeName="MyDatabaseDataContext" EnableInsert="True"
TableName="Customers">
</asp:LinqDataSource>
<div>
<asp:Button ID="btnDone" runat="server" Text="Done" />
</div>
</asp:Panel>
<cc1:ModalPopupExtender ID="mpeNewCustomer" runat="server" DynamicServicePath=""
Enabled="True" PopupControlID="pnlNewCustomer" TargetControlID="pnlNewCustomer"
BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnDone">
</cc1:ModalPopupExtender>
</asp:contentplaceholder>
protected void Button3_Click(object sender, EventArgs e)
{
cc1:ModalPopupExtender
var cust = Master.FindControl("mpeNewCustomer");
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do the ModalPopupExtender work, just not rendering correctly?
ASKER
OK The Issue I have is that when the modle popup is invoke I have a detailsview in the panel the detailsview has a checkbox and A insert button but I can't get anything to happen when the insert button is clicked
ASKER
That was a correct answer. A code snippet would have been a bit better.
ASKER
If real deal is the ModalPopupExtender that I want invoked from a content page that has a master page will not center / work correctly.