我有20多个动作进行图像处理,并将单个图像URL返回到部分视图,如下所示:
Public async Task<PartialViewResult> action1()
{
//Do some Image Manipulation tasks.
//Do some API Calls and returns Json.
//Some conditional checks.
Viewbag.ImageURL = UrlOfTheImageObtainedFromAThirdPartyWebsite;
return PartialView("_MyPartialView");
}
并继续......部分视图内容如下:
<div>
<img src="ViewBag.ImageURL" alt="the images is fetched from abc"/>
</div>
问题:这种情况有哪些优缺点?它会在HTTP请求之间产生任何冲突吗?还有更好的选择吗?谢谢!