Dear Experts,
Your Help is always Appriciated

Scenario:
OS.server 2003,
VB +ASP.NET
VS2005

My application is developed in 2003 on vs2003, now validation error while checking in design mode.
This application is using two classes with if condition.

Error 36 Cannot switch views: Validation (Internet Explorer 6): Attribute 'class' can be specified only once in a tag. 70

<td valign="top" align="center" nowrap <%if dx("stat")="N" then%> class="grrdata5" <%elseif dx("stat")="P" then%>  class="grrdata3" <%else%> class="isodata" <%end if%>>  <%=dx("stat")%>  </td>

Recommended Answers

All 4 Replies

I think it would be easier to add an ID and a runat="server" attribute to the TD and change the class from codebehind.
Just put a default class there, run the IF statement in the codebehind code and change the class from there.

Thnks Oxiegen,
Actually I am using CSS, runat server is behind. Valilldation mode is IE6 in VS2010.

That's kind of the point.
In codebehind you can set which CSS class to use at any given moment.

What you'll do is simply shifting from ASP style code to ASP.NET style code.

A second choice that you have is to use only one class specification, but perform the IF's and class changes using JavaScript.
There are many tutorials out there on how to accomplish this.

Thanks Oxiegen, I do try it and will share .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.