0

I have following code in my user control, and I want to access each control in this list either by accessing

  • or tag.

     <div class="menubarbackground">
        <ul>
            <li id="first" class="heigfbtitle">
                <a href="#" id="firstM" class="teegin mft5">1 First Item</a>
            </li>              
        </ul>
    </div>
    

    How do I implement the code to access these control in code behind?

  • 3
    • to access plain html code it has to be submitted to the server. see: stackoverflow.com/questions/389149/… Commented Feb 23, 2013 at 9:36
    • Use runat="server", which will allow you accessing the element from code-behind using it's Id. Commented Feb 23, 2013 at 9:45
    • 5
      These are not controls - they are just HTML elements. You need to use runat="server" if you want to use them as controls and access them on the server side. Commented Feb 23, 2013 at 9:49

    0

    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.