trying to call code behind function when clicking on row in itemtemplate in datalist - asp.net vb

the <tr> line used to read :-
onclick='<%# "openLocation(""EditProfile.aspx?MD=" & DataBinder.Eval(Container.DataItem, "BiogID") & """);" %>'

which called a javascript function which opened a new window with editprofile.aspx and the url parameter of the ID of the row in the datalist selected.

What i would like to do is change it so instead of calling a javascript function, it calls a code behind function, with the parameter AccountID. I have tried the following code, but it appears to still be looking for a javascript function, as it comes up with the error "Object Expected".

I would like to be able to keep it so that the user selects the whole line to call this function, but if i need to put a button against the line, then so be it.

any help greatly appreciated!
<ItemTemplate>
            <tr id="ItemRow"  runat="server" class="GridItem" onmouseover="this.className='GridItemOver';"
                onmouseout="this.className='GridItem';" onclick='<%# "getaccountdetails(" & DataBinder.Eval(Container.DataItem, "AccountID") & ")" %>' >
               
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "Account")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "AccountName")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "AccountTown")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "AccountPostcode")%>
                </td>
                <td>
                    <%#CStr(DataBinder.Eval(Container.DataItem, "LastLogin").ToString).Substring(0, 10)%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "SDBooked")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "SDBookWhen")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "ONBooked")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "ONBookWhen")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "INBooked")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "INBookWhen")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "PASBooked")%>
                </td>
                <td>
                    <%#DataBinder.Eval(Container.DataItem, "PASBookWhen")%>
                </td>
            </tr>
        </ItemTemplate>

Open in new window

richmorlAsked:
Who is Participating?
 
jorge_torizConnect With a Mentor Research & Development ManagerCommented:
I you want to call behind code you can create a custom control that implements ICallBackEventHandler

http://msdn.microsoft.com/en-us/library/system.web.ui.icallbackeventhandler.aspx
0
All Courses

From novice to tech pro — start learning today.