Datagrid Hyperlink columns

peterdoherty

Well-known member
Joined
Feb 24, 2003
Messages
49
Hi there I am having a bit of a problem using Hyperlink columns in ASP. What I want a javascript fo do is when a hyperlink is clickd upon a javascript function s executed. Below is the javascript function and the ASP datagrid hyperlink column that I wish to call the javascript from

<asp:HyperLinkColumn Text="Edit Appointment" Target="_new" DataNavigateUrlField="Appointment_ID" HeaderText="Edit Appointment" NavigateUrl="EditAppointment(3);">

<script language="javascript">
function EditAppointment(Integer id)
{
EditWin = window.open("Appointment.aspx?appointment_id="+id, "EditAppointment", "width = 400, height = 635, top = 100, left = 100, scrollbars = no, directories = no, status= no, toolbar = no, resizable = no");
}
</script>

When the Edit Appointmnet link is clicked on I would like to execute the javascript function EditApppointment and pass in the DataNAvigateURLField. Any ideas??

PS the EditAppointment(3); is only there for testing purposes to actually see if the javascript function will be called on the click of the hyperlink. I was going to move on to how to replace this with the DataBNAvigateURLField later.
 
<asp:HyperLink id=Hyperlink3 runat="server" Text=Edit Appointment NavigateUrl=<%# "EditAppointment(3)" %>>

Something like the above should work
 
UNfortunatly this doesnt work. I just get a DataBinding is not an event of System.Web.UI.WebControls.HyperLinkColumn. error. Any ideas?

Cheers

Peter
 
Back
Top