Change Href link from page to a open table

kdeutsch
kdeutsch used Ask the Experts™
on
What I would like the below link in my datagrid grid to do is actually present a table in front of the grid instead of opening up another page with information on it.  I want to use a table inside a div and put it on top with information inside it.  How can I change the link so that its a click event instead of a href tag to another page.


<asp:TemplateColumn HeaderText="Person">
							<ItemTemplate>
								<a href="EditACN.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "intId") %>" target=_blank>
									<%# DataBinder.Eval(Container.DataItem, "strFullName") %></a>
								</ItemTemplate>
							</asp:TemplateColumn>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
In the template, remove the <a> tag and put in a button or image button.  The rest should do the same.  That will give you a click event that you can trap.

Commented:
change to
 target=self

Commented:
or
Target="_parent"
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Commented:
target=_parent

Author

Commented:
all,

Ok I figured how I was doing is not the best way, I need the Href to change to a linkbutton which I can go after but how can i assign the name and data to pass thorought he click event. so Otherwise the linkebutton text should be strFullName and on the lcikc event it should pass the intId to the code behind,

So I guess how do i put this into the linkbutton, instead of the href.

<asp:TemplateColumn HeaderText="Person">
                                          <ItemTemplate>
                                                <asp:LinkButton id="lnkPerson" Runat="server" CommandName="Table"></asp:LinkButton>
                                          </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Person">
                                          <ItemTemplate>
                                                <a href="EditACN.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "intId") %>" target=_self>
                                                      <%# DataBinder.Eval(Container.DataItem, "strFullName") %></a>
                                                </ItemTemplate>
                                          </asp:TemplateColumn>
Commented:
see below code
----apsx code     

 <asp:LinkButton ID="lnkeditACN"  runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "strFullName") %>'  OnCommand="btnrep"    CommandArgument='<%# DataBinder.Eval(Container.DataItem, "intId") %>'> </asp:LinkButton></ItemTemplate>
                      


---code behind


    protected void btnrep(object sender, CommandEventArgs e)
    {

        int varintId
        

        varintId= Int32.Parse(e.CommandArgument.ToString());
               
    response.redirect("EDITACN.aspx?ID=" & varintId)

             }

Open in new window

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial