.Net produces span tag for CSS for Radiobutton controls

Posted on 2012-08-21
Last Modified: 2012-08-23

I am working on ASP.net2.0 website using C#

I have a .net radiobutton control as follows:

<asp:RadioButton ID="RadioButton1" class="js-required" data-validate="isFilled" runat="server" />

When it renders it produces the result

        <span class="js-required" data-validate="isFilled"><input id="RadioButton1" type="radio" name="RadioButton1" value="RadioButton1" /></span>

After rendering can .Net produces the result as follows:

<input id="RadioButton1" type="radio" name="RadioButton1" value="RadioButton1" class="js-required" data-validate="isFilled"/>

I mean I donot wanted <span class="js-required" data-validate="isFilled"> around input control

As it is giving hard time in jquery to understand radiobutton class

Please suggest

Question by:tia_kamakshi
    1 Comment
    LVL 18

    Accepted Solution

    try this
    RadioButton1.InputAttributes.Add("class", "js-required")

    Open in new window

    Go thro this link,

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
    In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now