Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET jQuery Gridview
Hi,
 
inside a grid view i have 3 buttons (a,b,c). On click of each buttons a modal popup must appear for getting user confirmation.
 
For this i tried using Ajax toolkit
ModalPopupExtender
but this asks
TargetControlID
in page load itself.
 
Now i am trying with jquery. here problem is not getting syntax to get client id of this button inside gridview.
Please help me solve this.
 
thanks in advance
Posted 30-May-12 0:41am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi ,
Check this Example with AJAX
Add Css to Grid and it will give you what you need like this Example
<style type="text/css">
.modalBackground
 
{
      background-color:Gray;
      filter:alpha(opacity=70);
      opacity:0.7;
}
.ModalWindow
{
 
  border: solid1px#c0c0c0;
  background:#f0f0f0;
  padding: 0px10px10px10px;
  position:absolute;
  top:-1000px;
}
 
    </style>
 
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:DropDownList ID="DropDownList1" runat="server">
        </asp:DropDownList>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Button ID="Button2" runat="server" Text="Button" />
                        <asp:ModalPopupExtender ID="Button2_ModalPopupExtender" runat="server" PopupControlID="Panel1" BackgroundCssClass="modalBackground"
                            DynamicServicePath="" Enabled="True" TargetControlID="Button2" CancelControlID="Button3">
                        </asp:ModalPopupExtender>
                        <asp:Panel ID="Panel1" runat="server" CssClass="ModalWindow">
                        Test
                        1
                      2  
                            <asp:Button ID="Button3" runat="server" Text="Close" />
                        </asp:Panel>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField></asp:TemplateField>
            </Columns>
        </asp:GridView>
    
    </div>
Best Regards
M.Mitwalli
  Permalink  
v2
Comments
Suraj S Koneri at 30-May-12 8:15am
   
Thanks for the Answer. But when i use your code i am getting panel inside the Gridview only.. but i want a panel which disables the background. like this ^
Mohamed Mitwalli at 30-May-12 8:56am
   
Check the solution i already updated
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Zoltán Zörgő 335
1 Peter Leow 155
2 BillWoodruff 120
3 CHill60 110
4 CPallini 80
0 Sergey Alexandrovich Kryukov 9,423
1 OriginalGriff 6,891
2 Peter Leow 4,692
3 Zoltán Zörgő 4,344
4 CHill60 2,932


Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 30 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100