java脚本和代码隐藏所需的帮助 [英] help required with java script and code behind

查看:93
本文介绍了java脚本和代码隐藏所需的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在图像区域显示员工的图像。当我将鼠标放在超链接/链接按钮上时,它应该将参数作为员工ID,

并显示其图像。当我拿走鼠标时它应该清除图像区域/隐藏图像。

例如

i已经编写了一个代码隐藏功能,当我点击按钮对话时显示员工图片雇员。它需要它的empid并检索它的图片。

现在我想做的是当我将鼠标移出/移出任何员工ID时我想显示/隐藏它的图片。



i在这方面需要帮助。

i want to display image of employee on an image area. when i put mouse over a hyper link/link button it should take parameters as employee id,
and display its image. when i take mouse away it should clear the image area/hide image.
for example
i have written a code behind function to show the employee picture when i click button against the employee. it takes its empid and retrieves its picture.
now what i want to do is that i want to display/hide its picture when i move mouse over/out of any employee id.

i need help in this regard.

page load()
{
 linkbutton.attributes.add("onmouseover","getEmpPic(someid)");
linkbutton.attributes.add("onmouseout","clrImage()");
}
void getEmpPic(empid)
{
// code to get image path
img.url='....'.jpg;
}
void clrImage()
{
img.visible=false;
}



想要在asp.net C#网页中使用此功能



问候


want this functionality in asp.net C# web page

regards

推荐答案

我假设你已经编写了在服务器端获取特定id的映像的逻辑。请参阅以下代码:

I assume you have written the logic for getting the image for particular id on server-side. See the below code:
<a href="#" data-id="2" class="empName">CodeProject</a>


(。empName)。hover(function(){
getEmpImg(
(".empName").hover(function() { getEmpImg(


(this).attr( data-id));
});
(this).attr("data-id")); });


这篇关于java脚本和代码隐藏所需的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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