Calling a JavaScript Function From DataGrid Control
-
I want to call a javaScript Function from DataGrid Control. I hv a DataGrid and there is an LinkButton Button and Customer Name is Displayed on that, I want if some one Click on that Link Button a javaScript Function should b called and also I want to Send ID to that function, How is that possible. My Code is here. ]]>'> Please Help Me, Thanks in Advance.
-
I want to call a javaScript Function from DataGrid Control. I hv a DataGrid and there is an LinkButton Button and Customer Name is Displayed on that, I want if some one Click on that Link Button a javaScript Function should b called and also I want to Send ID to that function, How is that possible. My Code is here. ]]>'> Please Help Me, Thanks in Advance.
add an onclick to the button. Any attributes that are not recognised by ASP.NET are passed through verbatim to the client.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I want to call a javaScript Function from DataGrid Control. I hv a DataGrid and there is an LinkButton Button and Customer Name is Displayed on that, I want if some one Click on that Link Button a javaScript Function should b called and also I want to Send ID to that function, How is that possible. My Code is here. ]]>'> Please Help Me, Thanks in Advance.
hi, Did u try with OnClientClick propery of link button by passing 'this' as a parameter?
**$**herin Iranimose
-
I want to call a javaScript Function from DataGrid Control. I hv a DataGrid and there is an LinkButton Button and Customer Name is Displayed on that, I want if some one Click on that Link Button a javaScript Function should b called and also I want to Send ID to that function, How is that possible. My Code is here. ]]>'> Please Help Me, Thanks in Advance.
-
hi, Did u try with OnClientClick propery of link button by passing 'this' as a parameter?
**$**herin Iranimose
I applayed all above methods but it s not working.
-
I applayed all above methods but it s not working.
coolmindd wrote:
but it s not working.
means some error?
**$**herin Iranimose
-
I applayed all above methods but it s not working.
Now I applayed the following Method and it is working Public Sub itembound(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Dim script As String If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then CType(e.Item.Cells(0).FindControl("name"), LinkButton).Attributes.Add ("onclick", "window.open('/code/customer/addressbook/default.aspx?id=" & dgD.DataKeys.Item(e.Item.ItemIndex) & "','', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=800,height=600,left = 176,top = 132'); return false;") End If End Sub But I want to Send ID not name to that popup page. If u can see there in query string Name is going. How can I send ID to that page.
-
I want to call a javaScript Function from DataGrid Control. I hv a DataGrid and there is an LinkButton Button and Customer Name is Displayed on that, I want if some one Click on that Link Button a javaScript Function should b called and also I want to Send ID to that function, How is that possible. My Code is here. ]]>'> Please Help Me, Thanks in Advance.
Now the function is working but when I click first time , it is not working, when I click second time then it works. But I m not able to send ID which is on Cell 0 nd the link button is on cell 1.