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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jorge_torizResearch & 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.