如何将数据绑定到滚动图像 [英] How to bind data to scrolling images

查看:98
本文介绍了如何将数据绑定到滚动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上滚动员工图片,当我点击员工图片时,它会在empdetails.aspx页面显示员工详细信息。



所有员工字段均为同样,例如Id名称薪资地址。

和数据库表是Id名称薪资地址所有员工详细信息应该只插入一个表中,如果我点击我网站上的任何图像,它将被重定向到userdetails .aspx page

I am scrolling employee images in my website,When i click on employee image ,it display the employee details in empdetails.aspx page.

All employee fields are same, for example Id Name Salary Address.
and database table is Id Name Salary Address all employee details should be inserted in only one table,and if i click any image in my website it will redirected to userdetails.aspx page

推荐答案

是的,这可以做到。

按照以下步骤 -



注意:我假设您必须拥有像gridview,repeater,datalist等数据绑定控件来显示员工图像。如果不是这样,请告诉我。



1.将图像包裹在锚标签中,如

Yes, this can be done.
Follow the following steps-

Note :I am assuming that you must have a databound control like gridview, repeater, datalist etc. to show the employee images. Please let me know if this is not the case.

1. Wrap the image inside an anchor tag like
<a href="userdetails.aspx?id="+<%#Eval("Id")+"">
<img src="your_img_url">
</img></a>



2.现在单击图像,它将重定向到userdetails.aspx,其ID为查询字符串值。

3.在user_Ltails.aspx的Page_Load()中编写代码以从数据库中检索数据并在页面上显示。



希望它有帮助。



如果您需要进一步的帮助,请提供所需的代码片段并告诉我们:))


2. Now clicking the image, it will redirect to the userdetails.aspx with query string value for Id.
3. In Page_Load() of userdetails.aspx write code to retrieve the data from database and show on the page.

Hopefully, it helps.

In case, you need further assistance, please provide required code snippets and let me know :)


这篇关于如何将数据绑定到滚动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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