2

I'm having an issue finding an UpdatePanel inside of a Gridview inside of a Formview in Javascript. The Below Doesn't work.

 var UpdatePanel3 = $get('<%=FormView1.FindControl("Gridview1").FindControl("UpdatePanel3").ClientID %>');

How can I find that control??

4
  • can you show ur complete page source, It will help us to find your problem Commented Oct 14, 2009 at 19:03
  • asp.net rewrites the clientside id's when you nest controls. He would end up with something like formview1_ctl00_gridview1_updatepanel3 or something, with all sorts of mess as the clientid. Commented Oct 14, 2009 at 19:05
  • @Chad- thats half way true, I forgot about that asp web control extra garbage. but its not because its controls nested within, its just a name router way asp webcontrols get when used, if it was a regular html control, that extra garbage wouldnt happen Commented Oct 14, 2009 at 19:09
  • @TStamper, pardon? If you don't nest controls or pages (master->page) they won't get that extra garbage. It's a way to keep the controls unique. Asp.net's engine does this. Not the browser or anything else. Commented Oct 14, 2009 at 19:41

2 Answers 2

3
$get('<%=UpdatePanel3.ClientID %>');

better way

Sign up to request clarification or add additional context in comments.

Comments

0

Easiest way is going to be with jquery. Add a class to the gridview and do a $(".cssClassName")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.