views:

572

answers:

2

I have a ASP.NET MVC application. The code in the aspx is like that

<input '<%= ViewData["Disabled"] %>' class="Text1" type="text" name='test' value='0'/>

ViewData["Disabled"] contains at this state a string =

'disabled="disabled"'

the result in firefox:

<input class="Text1" type="text" value="0" name="test" disabled="disabled"/>

the reuslt in ie8:

<input name="test" class="Text1" type="text" ?="" ?disabled="disabled" value="0"/>

Why is the output like this?

+3  A: 

Maybe try getting rid of the enclosing single-quotes:

<input <%= ViewData["Disabled"] %> class="Text1" type="text" name='test' value='0'/>
karim79
+2  A: 

I think it might be the quotes

Try:

<input <%= ViewData["Disabled"] %> 
       class="Text1" 
       type="text" 
       name='test' 
       value='0'/>

Kindness,

Dan

Daniel Elliott