是否可以直接从return语句获取图像 [英] Is it possible to get the image directly from the return statement

查看:136
本文介绍了是否可以直接从return语句获取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在if条件下,如果在return语句中给出了图像路径,那么是否会加载图像?
例如:

In the if condition,at the return statement if we give the the image path, then the image will be loaded or not?
for example:

if (status == "1")
            return "<img src=C:\Users\bhuvisdesktop2.BHUVIS\Desktop\kendoui grid/>";



如果不是,那么如何给出路径



if not, then how to give the path

推荐答案

否.
所有要做的就是返回一个包含大量HTML的字符串.
除非稍后通过Response.Write将字符串输出到您的页面,否则它将不会对您的页面执行任何操作.
您想达到什么目的,您认为这会有所帮助?
No.
All that is doing is returning a string containing a chunk of HTML.
Unless you output the string later to your page via Response.Write it will not do anything to your page.
What are you trying to achieve, that you think this will help?


首先
这不是返回图片的声明
它只返回一个字符串
您可以将其放置在html页面中的任何位置

第二
您想在哪里编写此代码?
js

C#
first of all
this is not a statement of return image
it returns only a string
you can place it any where in html page

second
where you want to write this code??
js
or
C#


这篇关于是否可以直接从return语句获取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆