ASP.NET MVC : AJAX ActionLink- Target an HTML attribute

后端 未结 3 529
名媛妹妹
名媛妹妹 2021-01-13 01:35

I have an Ajax actionlink that requests a string in the controller method. I want to insert that string into an attribute of a hyperlink. HOw do I specify the attribute fiel

3条回答
  •  深忆病人
    2021-01-13 01:51

    Much simpler I guess, you could use Url.Action (the action you set the one that returns the string you want, but instead of returning you use Response.Write(...).

    Or even simpler, you use src="<%= ViewData["src"] %>" in your tag!

    I see you already have a solution, but this could save you time next time..

提交回复
热议问题