Click here to Skip to main content
11,647,659 members (74,178 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 jyo.net 500
1 F-ES Sitecore 370
2 OriginalGriff 322
3 DamithSL 315
4 CPallini 240
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 795


Advertise | Privacy | Mobile
Web04 | 2.8.150804.3 | 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