Solved

Displaying a modal pop up extender at the time of inserting a record in Details View Control

Posted on 2010-11-22
10
369 Views
Last Modified: 2012-05-10
I need to pop up a Modal pop up extender, at the time of clicking a insert/save button in the Details View control.
0
Comment
Question by:Ammar Iqbal
  • 6
  • 4
10 Comments
 
LVL 10

Expert Comment

by:Nash2334
ID: 34188222
You can do this in code after processing the OnClick:

MyModalPopupExtender.Show();
MyModalPopupExtender.Hide();
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34188320
how to get this MyModal PopExtender id in the code behind. I am not getting it, and I can not access it either by DetailsView1.FindControl("aaaa")
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34190073
I have managed to  display the model pop up extender,on the click of the Save button when user is about to insert a new record. THe model pop up appears, but it does not disable the rest of the window.
<InsertItemTemplate>

                                 <asp:Panel ID="pnlUserNotification" runat="server" CssClass="" OkControlID="btnOKUserNotifcation" CancelControlID="btnCancelUserNotification" DropShadow="true">

                                     <div style="width:400px; height:400px; background-color:White">

                                         Notify Users

                                     <br />

                                      <asp:Button runat="server" ID="btnOKUserNotification" Text="OK" />

                                       <asp:Button runat="server" ID="btnCancelUserNotification" Text="Cancel" />    

                                       

                                       <table>

                                          <tr>

                                            <td><asp:Label ID="lblComm" runat="server" Text="Type:"></asp:Label></td>

                                            <td><asp:DropDownList ID="i_communicationtype" runat="server" DataMember="CommunicationType" DataTextField="name" DataValueField="id" ></asp:DropDownList></td>

                                           

                                          </tr>

                                          

                                          <tr>

                                            <td><asp:Label ID="lblRole" runat="server" Text="Role:"></asp:Label></td>

                                            <td><asp:DropDownList ID="i_role" runat="server" DataMember="aspnet_roles" DataTextField="RoleName" DataValueField="RoleId"></asp:DropDownList></td>

                                             <td><asp:Button ID="btnaddRole" runat="server" Text="Add Role" /></td>

                                          </tr>

                                          

                                           <tr>

                                             <td><asp:Label ID="lbluser" runat="server" Text="User:"></asp:Label></td>

                                             <td><asp:DropDownList ID="i_user" runat="server" DataMember="aspnet_Users" DataTextField="UserName" DataValueField="UserId"></asp:DropDownList></td>

                                             <td><asp:Button ID="btnaddUser" runat="server" Text="Add User" /></td>

                                           </tr>

                                        </table>

                                        

                                        <table>

                                          <tr>

                                            <td><asp:Label ID="lblTo" runat="server" Text="To:"></asp:Label></td>

                                            <td><asp:TextBox ID="txtTo" runat="server" TextMode="MultiLine" Width="220"></asp:TextBox></td>

                                         </tr>

                                        </table>

                                        

                                         

                                     </div>

                                      

                                 </asp:Panel>

                                 <asp:LinkButton ID="i_insert" runat="server" CausesValidation="False" 

                                    CommandName="Insert" CssClass="button" Visible="<%# IsAdmin %>"  OnClick="btn_SaveClick">

                                    <span class="ui-icon ui-icon-check"></span>Save

                                </asp:LinkButton>

                                <asp:LinkButton ID="i_cancel" runat="server" CausesValidation="False" 

                                    CommandName="Cancel" CssClass="button" Visible="<%# IsAdmin %>">

                                    <span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>Cancel

                                </asp:LinkButton>

                                <act:ModalPopupExtender ID="mpeUserNotification" runat="server" TargetControlID="i_insert" 

                                  OkControlID="btnOKUserNotification" CancelControlID="btnCancelUserNotification" PopupControlID="pnlUserNotification"   DropShadow="true" >

                                </act:ModalPopupExtender>

                            </InsertItemTemplate>

Open in new window

0
 
LVL 10

Expert Comment

by:Nash2334
ID: 34190353
Not sure what you mean; are you applying the right background CSS class for when the modalpopupextender is activated?
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34192206
I am not applying any csss for modal pop up extender.. is there any specific css class for this?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 10

Accepted Solution

by:
Nash2334 earned 500 total points
ID: 34192711
If you want it to appear disabled, you need to apply a CSS class when the modal popup is displayed.  You need to add a BackgroundCssClass to your MPE and then define a CSS class to support it, e.g.

.modalPopup
{
    background-color: #000;
    filter: alpha(opacity=70);
    opacity: 0.7;
}
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34193805
should i include this .css definition of modalPopUp in my orignal project css?
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34193815
and the fact is that I want to make The window disabled, so that it is inaccessible to the user as long as the modal pop up extender is active
0
 
LVL 10

Expert Comment

by:Nash2334
ID: 34196356
You can add the CSS class anywhere it makes sense to do so for your solution; the original project CSS is as good a place as any.  Once the CSS is class is defined and applied with the extender you should see the desired effect.  Good luck!
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 34196623
Hi Nash2334,
I have added one button control on the modal pop up extender, and ihave sone functionality in it, The problem is that when ever I click on this button, the pop up foes off , and the whole window gets enabled. What should I add to this button functioanlity ,so that the pop up remains until and unless, i click another "ok" button.
But not on this button
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# application error "Parameter Is Not Valid". 3 79
Export import database 4 42
C# MVC and a global static factory that never dies 4 47
Variable Event ? 3 22
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

25 Experts available now in Live!

Get 1:1 Help Now