views:

317

answers:

1

in my route table I have this entry

routes.MapRoute(
            "myRoute",
            "route/{controller}/{action}/{id}/{start}/{end}",
            new { controller = "Home", action = "Index", id = "", start="", end="" }
        );

in my master page I have a line of code like so:

<%= Html.TextBox("foo", "bar") %>

If I access the page in the form of http://mysite.com/route/Home/Index/id/start/end the textbox renders OK with a value of "bar" However if I access the page using the default parameters http://mysite.com/route/ the textbox does not have a value! In the emitted HTML it shows up like so:

<input id="foo" type="text" value="" name="foo"/>

it didn't set the value to "bar"...is this a bug? or is this not allowed in mvc master pages?

A: 

it should work fine

" <%= Html.TextBox("name", "Please enter your name...")%>

Output : < input id="name" name="name" type="text" value="Please enter your name..." />

SattiS