model view controller - Url.Action Does Not Show Data -
I'm trying to get back to see a ActionResult to a string
controller < / P>
public action GetName (string id) {string returnName; ReturnName = m_DB.UserProfiles.Find (id). first name; Return content (refund name); }
View
& lt; Li & gt; @ Url.Action ( "GetName", "UserProfile", new {id = User.Identity.GetUserId ()}) & lt; / Li & gt;
When I run, it only shows it in this view
/ UserProfile / GETNAM / 7781341a-ab1b-4b1d-b75b-853376690bf4
< P> I want to show all the user's first name. What am I doing wrong? Please help. I appreciate your contribution I
I think the method you're looking for is < code> @ html.RenderAction or @ html.action
@ html.RenderAction ( "GetName", "UserProfile", new {id = User .Identity.GetUserId ()})
or
@ Html.Action ( "GetName", "UserProfile", new {id = User.Identity .GetUserId ()})
@ Url.Action
while you take those parameters which you provide it and creates a URL @ Html.RenderAction
the result of the inline view of the action Ekhankit is that where called.
Comments
Post a Comment