Javascript函数在asp.net中返回图像 [英] Javascript function return image in asp.net

查看:72
本文介绍了Javascript函数在asp.net中返回图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我想在asp.net中创建一个返回图像的JavaScript函数.该图像存储在Visual Studio的解决方案资源管理器中(意味着它存储在项目中),然后我可以在asp.net Button Control的onClientClick上调用该函数.

默认情况下,在加载.aspx页面时,图像可见性应该为false.当我单击asp.net按钮时,图像应该可见吗?

非常感谢您的帮助.

Hi all

I want to create a JavaScript function in asp.net which returns an image. The image is stored in the solution explorer of visual studio(means it is store in project) and than I can call that function onClientClick of asp.net Button Control.

By default the image visibility should be false on page load of .aspx page. When I click on the asp.net button the image should be visible?

Any help is greatly appreciated.

推荐答案

能否给我发送代码,说明如何在asp.net中的javascript中创建函数,并在onclient上单击按钮在asp中调用它.net =
不!

您在这里并不陌生,但是您会发布类似这样的问题.请避免.
再一次,它在这里不能这样工作.这里没有快速的问题.这听起来像是您的大学项目/作业,您应该付出一些努力.

我们希望您花一些时间来尝试解决您面临的问题,然后再花一些时间在此处发布问题时提出问题.

这是询问者的期望:
1. 先尝试您要做什么!
2.制定看起来像问题/无法解决的问题.

试试看,告诉他们是否遇到问题.
成员将非常乐于提供这样的帮助.
Can you please send me code how to create function in javascript in asp.net and call that on button onclientclick in asp.net=
No!

You are no new here and yet you post questions like these. Please avoid it.
Once again, It does not work like this here. There is no quick question here. This sounds like your college project/assignment, you should put some effort.

We expect you to put some time in trying the issue that you are facing and then some time in formulating the question while posting here.

Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.


<asp:button id="button1" runat="server" onclientclick="javascript:


get('<% img.ClientID %> ').style.display = 'block'; return false;" 文本 =" / > < asp:image id =" runat 服务器" ImageURL 某物" 样式 display:none;" /
get('<%img.ClientID %>').style.display = 'block';return false;" Text="view image" /> <asp:image id="img" runat="server" ImageURL="something" style="display:none;" />



我使用return false来防止回发.



i used return false to prevent post-back.


这篇关于Javascript函数在asp.net中返回图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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