Click here to Skip to main content
15,909,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False"
        OnRowCommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing" >

    <columns>
    <asp:BoundField HeaderText="ID" DataField="ID" />
    <asp:BoundField HeaderText="Name" DataField="ContactName" />
    <asp:BoundField HeaderText="Company" DataField="ContCompany" />
    <asp:BoundField HeaderText="Profession" DataField="ContProfession" />
    <asp:BoundField HeaderText="Address1" DataField="ContAdd1" />
    <asp:BoundField HeaderText="Address2" DataField="ContAdd2" />
    <asp:BoundField  HeaderText="City" DataField="ContCity" />
    <asp:BoundField  HeaderText="Pincode" DataField="ContPincode" />
    <asp:BoundField  HeaderText="Type" DataField="ContType" />
    <asp:BoundField  HeaderText="Status" DataField="ContStatus" />
    <asp:TemplateField>
    <ItemTemplate>
    <asp:LinkButton ID="Edit" runat="server" OnClick="Show_Button_click" Text="Edit" CausesValidation="False" />
    </ItemTemplate>
    </asp:TemplateField>
    </columns>
    </asp:GridView>
<asp:AnimationExtender ID="popupanimation" runat="server" TargetControlID="Edit">
    <Animations>
                <OnClick>
                    <Parallel AnimationTarget="Panel1"
                    Duration="0.3" Fps="25">
                    <FadeIn />
                    </Parallel>
                </OnClick>
            </Animations>
    </asp:AnimationExtender>
Posted
Comments
Dnyaneshwar Kondbale 17-Apr-13 8:05am    
Add one dummy button which is Link as Target control ID for animation extender ..

In "Show_Button_click" method call for dummy button click .
jacobjohn196 17-Apr-13 8:11am    
Once i have used OnClick event for Modal Popup
<asp:LinkButton ID="Edit" runat="server" OnClick="Show_Button_click" Text="Edit" CausesValidation="False" />
Dnyaneshwar Kondbale 17-Apr-13 8:16am    
Show_button_click is it method??
jacobjohn196 17-Apr-13 8:19am    
Yeah,,i wrote like this
protected void Show_Button_click(object sender, EventArgs e)
{
LinkButton Edit = (LinkButton)sender;
GridViewRow gvrow = (GridViewRow)Edit.NamingContainer;
lblID.Text = gvrow.Cells[0].Text;
txtname.Text = gvrow.Cells[1].Text;
txtcompany.Text = gvrow.Cells[2].Text;
txtprofession.Text = gvrow.Cells[3].Text;
txtadd1.Text = gvrow.Cells[4].Text;
txtadd2.Text = gvrow.Cells[5].Text;
txtcity.Text = gvrow.Cells[6].Text;
txtpincode.Text = gvrow.Cells[7].Text;
ddltype.Text = gvrow.Cells[8].Text;
ddlstatus.Text = gvrow.Cells[9].Text;
this.ModalPopupExtender1.Show();

}
Dnyaneshwar Kondbale 17-Apr-13 8:26am    
As per above comment add one dummy button with ID=btnDummy
set this button as Target contrl id for animation extender then
write code line

btnDummy.click();

after the line

this.ModalPopupExtender1.Show();

1 solution

TargetControlID will take ClientID of the link button. If AnimationExtender and LinkButton is there in the same panel or control then ClientID of LinkButton will be easily accessible by AnimationExtender. Try this:
ASP.NET
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
        OnRowCommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing" > 
    <columns>
    <asp:boundfield headertext="ID" datafield="ID" />
    <asp:boundfield headertext="Name" datafield="ContactName" />
    <asp:boundfield headertext="Company" datafield="ContCompany" />
    <asp:boundfield headertext="Profession" datafield="ContProfession" />
    <asp:boundfield headertext="Address1" datafield="ContAdd1" />
    <asp:boundfield headertext="Address2" datafield="ContAdd2" />
    <asp:boundfield headertext="City" datafield="ContCity" />
    <asp:boundfield headertext="Pincode" datafield="ContPincode" />
    <asp:boundfield headertext="Type" datafield="ContType" />
    <asp:boundfield headertext="Status" datafield="ContStatus" />
    <asp:templatefield>
        <itemtemplate>
            <asp:linkbutton id="Edit" runat="server" onclick="Show_Button_click" text="Edit" causesvalidation="False" />
            <asp:animationextender id="popupanimation" runat="server" targetcontrolid="Edit">
            <animations>
                <onclick>
                    <parallel animationtarget="Panel1">
                    Duration="0.3" Fps="25">
                        <fadein />
                    </parallel>
                </onclick>
             </animations>
            </asp:animationextender>
            <asp:panel id="Panel1" runat="server"></asp:panel>
        </itemtemplate>
    </asp:templatefield>
    </columns>
</asp:gridview>



--Amit
 
Share this answer
 
Comments
jacobjohn196 18-Apr-13 0:38am    
Thank you Amit. I tried this code,but its also not working.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900