Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 单击按钮后在mvc2中显示图像_Asp.net_Asp.net Mvc 2 - Fatal编程技术网

Asp.net 单击按钮后在mvc2中显示图像

Asp.net 单击按钮后在mvc2中显示图像,asp.net,asp.net-mvc-2,Asp.net,Asp.net Mvc 2,我只需要在asp.net mvc2中单击按钮后显示图像 但我甚至在点击之前和点击之后都能得到它 有人能告诉我为什么会发生这种情况吗?试试下面的句子: <html> <head> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <button>Show it</button> &

我只需要在asp.net mvc2中单击按钮后显示图像 但我甚至在点击之前和点击之后都能得到它
有人能告诉我为什么会发生这种情况吗?

试试下面的句子:

<html>
<head>
  <script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
  <button>Show it</button>

      <img src="url" style="display: none" />
<script>
    $("button").click(function () {
    $("img").show("slow");
    });
    </script>

</body>
</html>

你能提供一些关于你的按钮应该触发的过程的更多信息,以及到目前为止你已经尝试了什么吗?您是否只想在点击时显示图像,而这可以通过JS Order轻松完成?您是否真的想加载它?您可以通过JS/Ajax或控制器操作来完成?