views:

60

answers:

3

i am doing an ajax call and i refresh a partial view. Inside the partial view i have this:

<%=Html.TextBox("instance.Id", Model.Id)%>

when i put a breakpoint here over Model.Id it has a number in it but after the ajax refresh is done the textbox just shows up with a 0. When i do a full browser refresh, the correct number shows up in the textbox.

when i use firebug to look at data in my callback i see this:

<input id="instance_Id" name="instance.Id" type="text" value="0" /> 

Everything else in the partial view refreshes fine.

any ideas on what could be going wrong here?

A: 

Have you debugged the AJAX call (Firebug/Fiddler) to make sure the data is coming across? I suspect there is code running in the "host" Action that is not running in the AJAX Action...

Dave Swersky
@Dave Swersky - i updated the question with what came back from the ajax call when i used firebug . .
ooo
A: 

Can you post your controllers code? And maybe your Ajax.BeginForm() code (or howevery you setup your ajax form) ?

Jack
A: 

i changed the code above to hand roll the creation of the textbox (instead of using Html.Textbox and everything worked fine.)

ooo