For example I got a <asp:FormView> and there are IDs inside. Why is that I can’t get one of the ID inside the <asp:FormView>, the error shows as “The name ‘commentsLabel’ does not exist in the current context“
How to get the ID of one of the <asp:TextBox> that is inside <asp:FormView> ?
Thank you.
The question isn’t very clear, but I suppose this is what you have:
and you want to access
commentsLabelin the code behind of the control/page on which you have this markup.Since
FormViewis a naming container, you can find the controls inside it like this: