Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello Friends,
I want to display panel on click of grid edit button, how can i bind this event to edit link.

I tried following, but it did not worked

In rowdatabound event, I tried to bind javascript function popUp
Private Sub gvJobs_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvJobs.RowDataBound
        If IsDBNull(e.Row.DataItem) Then
            Return
        End If
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim lnkEdit As New HtmlAnchor
            Dim gvRow As GridViewRow
            gvRow = e.Row
            lnkEdit = gvRow.FindControl("lnkEdit")
            lnkEdit.Attributes("onclick") = "popUp()"
        End If
        
    End Sub


I wrote javascript function popUp
<script language="javascript" type="text/javascript">
        function popUp() {
            $('#divEdit').sidetoggle(fast);
        }
    </script>


May i know where I'm going wrong, or is there any other way to carry out this task. I'm using master pages.

Thanks in advance
Posted

see my answer at

Display popup with a like in datagrid[^]

Thanks.
 
Share this answer
 
Comments
dhage.prashant01 24-Jun-11 5:06am    
Where my code is going wrong, any idea?
dhage.prashant01 24-Jun-11 5:19am    
I got where is the error, in javascript function
$('#divEdit').sidetoggle(fast);
It says, object expected, any other way to toggle div?
dhage.prashant01 24-Jun-11 6:39am    
Its working for me, but problem is when I add table to div it gives XML parser error.
Any idea or solution?
Tarun Mangukiya 24-Jun-11 12:59pm    
Adding table to div tag is not valid so you can use p(paragraph) tag to add a table.
dhage.prashant01 27-Jun-11 3:26am    
Even after using p(paragraph) tag, it gives the XML parser error [:(]
 
Share this answer
 
v2
Tarun is right. Assign javascript function to the HRef property. It worked for me.
 
Share this answer
 
Comments
dhage.prashant01 24-Jun-11 5:06am    
Even I tried assigning function to HREF in RowDataBound event, still it not working. Any idea?

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