views:

40

answers:

1

This works fine:

Controller.cs

ViewData["MyText"] = "Hello World";   

Index.aspx

<%: Html.Label(ViewData["MyText"].ToString()) %>

But the complete text is not displayed when I add just a dot "." to "Hello World". I thought "<%:" takes care for this but it seams that this is not true...

How to solve this? How to mask the dot?

Changing "." with "%2E" doesnt work ;-(

Thanks in advance!

+1  A: 

I don't think you're using the Label() extension correctly. Try this:

<%: Html.Label("MyText") %>

or this:

<label><%: ViewData["MyText"] %></label>
Peter
Thanks you very muc hthis works! (sorry I am a MVC beginner/newbie)