0
<td class="ui-widget-header gvHeader ui-helper-hidden" style="width: 17%" runat="server" id="tdPack">
Pack :
</td>

I want to remove the class 'ui-helper-hidden' using C# code. How ?

2
  • 3
    Please add way more context about what you are doing and where (on the server? In a client program? Where does the HTML come from?) Commented Feb 21, 2011 at 13:03
  • I would like to remove the class ( only the 'ui-helper-hidden') using C# Code. Commented Feb 21, 2011 at 13:15

2 Answers 2

0

assuming several things due to lack of details, you might try:

tdPack.CssClass = tdPack.CssClass.Replace("ui-widget-header", String.Empty);

or if that is HtmlTableCell than:

tdPack.Attributes["class"] =
       Attributes["class"].Replace("ui-widget-header", String.Empty);
Sign up to request clarification or add additional context in comments.

1 Comment

here is a more explicit example with some helper methods stackoverflow.com/questions/445967/…
0

first of all, you should retag your question!
then: provide more information!
then: i assume that ui-helper-hidden is added by a plugin - this means, that this is not the rendered source rather the computed sourced - you will not be able to change the class-attribute...
the crucial question: do you know the difference between server- and client-side?

you will have to use jquery or any other javascript (lib), to do sth like

$(document).ready(function () {
    var $cell = $('#yourControlId);
    // or
    var $cell = $('.ui-helper-hidden');
    $cell.removeClass('ui-helper-hidden');
});

another crucial question here:
if this is your code, why don't you leave the unwanted ui-helper-hidden-class out? your supported code shows, that you have the control over the code and there's no plugin or sth alike involved ...

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.