Click here to Skip to main content
11,705,763 members (38,661 online)
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 29-May-12 23:41pm
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 OriginalGriff 213
1 Sergey Alexandrovich Kryukov 170
2 Inimicos 60
3 ProgramFOX 50
4 F-ES Sitecore 45
0 OriginalGriff 9,037
1 Sergey Alexandrovich Kryukov 8,417
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,626


Advertise | Privacy | Mobile
Web03 | 2.8.150819.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