ASP.net ASPX页面加载 [英] ASP.net ASPX page load
问题描述
我有一个div标签,例如:
Hi,
I have a div tag, eg:
<div id="someid" style="width:10px;height:20px;border:solid blue 1px">some content</div>
div标签内部是一个文件上传按钮,
在页面加载时,我想隐藏div和fileupload按钮.
我正在使用图像onmouseclick进行触发:
使用jquery取消隐藏div
使用后面的代码将按钮可见性设置为true(C#)
如何同时使用jquery和c#代码来完成此任务?
尝试在我的ASPX html中用jquery隐藏div时,我也遇到错误:
我正在使用
inside the div tag is a fileupload button,
On page load I want to hide the div and the fileupload button.
I am using an image onmouseclick to fire :
using jquery to unhide the div
use code behind to set the button visibility to true (C#)
How can you use jquery and also c# code behind at the same time to accomplish this ?
I am also getting errors trying to hide the div with jquery in my ASPX html:
I am using
<script type="text/javascript">{$('someid').hide();}</script>
任何决议,将不胜感激:
谢谢,
[edit]已添加代码块,HTML编码-OriginalGriff [/edit]
Any resolutions would be appreciated:
Thanks,
[edit]Code block added, HTML encoded - OriginalGriff[/edit]
推荐答案
(' someid').hide();} < / 脚本 >
('someid').hide();}</script>
任何决议,将不胜感激:
谢谢,
[edit]添加了代码块,HTML编码-客户端中的OriginalGriff [/edit]
Any resolutions would be appreciated:
Thanks,
[edit]Code block added, HTML encoded - OriginalGriff[/edit]
使用javascript:
in client side use javascript :
document.getElementById("BodyMainContent").style.visibility="hidden";
在服务器端使用c#首先替换面板而不是div:
1-如果需要ajax,则首先应该有一个脚本管理器,并为mouseclick事件定义一个触发器,然后将runat ="server"添加到面板标签中,然后使用此代码:
in server side using c# first replace panel instead of div:
1- if you need ajax you should first have a script manager and define a trigger for mouseclick event then add runat="server" to panel tag then use this code :
Panel1.visible=False
2-如果您不需要ajax,那么只需添加相同的代码即可:
2- if you dnt need ajax so just add same code :
Panel1.visible=False
这篇关于ASP.net ASPX页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!