0

I understand that I currently can't use <a onclick="alert('<%=TextBox1.ClientID%>')" directly because I need to access it in a table cell in a table in the EditTemplate of a DataList inside a UserControl.

That said, I need to recursively check the controls to get the ClientID, should it be done
client-side: alert(getMyElement('TextBox1').id), where getMyElement checks all elements of the form and returns the control with the id...or
server-side: alert('<%=FindElement(dlDataList, "TextBox1").ClientID%>') where FindElement is a base page function that checks the controls of the first param for an element with an id of the second param and returns that control ?

I'm figuring the client-side would be faster?

eych
  • 1,262
  • 2
  • 16
  • 37

1 Answers1

0

I always go with server side for this case. Otherwise you're traversing the entire DOM with each row - depending on the size, it could be a memory hog. Server side takes almost no resources for this.

ChickenMilkBomb
  • 939
  • 6
  • 18