It's not possible because TempData only exists in server-side coding and you're trying to use it on the client in javascript. If the js is directly on the view you could do something like
value='@TempData["MyMessage"]';
That will only work if the TempData was set before the page was sent to the client though, it won't work if TempData is set in the ajax method. This is because your view is generating static html that is sent to the client, so if you look at the source you'll see your js look like
success: function (result) {
value='Whatever is in TempData when the page loads';
If nothing is in TempData then it will look like
success: function (result) {
value='';
So no matter what happens inside your ajax method, the success event in your js is always going to set value to be the same thing. Remember js runs off whatever is sent to the client, not from your cshtml view, and your .net code isn't running "inside" the browser, the browser's html is not a live object your server code can freely interact with.
However what you should do is make your request return an object with two values, the success and the message
return Json(new{success=true, value=MyMessage}, JsonRequestBehavior.AllowGet);
in your js;
success: function (result) {
success = result.success;
value=result.value;