tags:

views:

60

answers:

2

For some odd reason I can't seem to communicate w/ my span or div in the view using MVC as I have shown below - what am I missing here? (for the moment please ignore the magic strings example)

<span id="UserFeedback"></span>

ViewData("UserFeedback") = "broken"
+6  A: 

?:

<span id="UserFeedback"><%= ViewData("UserFeedback") %></span>
eu-ge-ne
A: 

eu-ge-ne's answer is correct. Just remember that MVC does not use the server controls and code behind that you are familiar with in WebForms, so you won't be setting text properties in your code.

MVC gives you complete control over the HTML output that is rendered from your views. This is great, but it means that you have to specify the text that will be rendered instead of relying on server controls to spit out a bunch of auto generated html and javascript.

Personally, I love having the complete control. Javascript can access span and div id's as I specify them without having to worry about checking what client id the asp.net server control decided to give them.

Dennis Palmer