Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
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
Posted
Comments
udham singh(tss) 12-Dec-14 8:52am    
Hi,
Question is not clear. Your page is get redirected on userdetails.aspx on click of image. do u want to stop this Or something else.

1 solution

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
HTML
<a href="userdetails.aspx?id="+<%#Eval("Id")+"">
<img src="your_img_url">
</img></a>

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 :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900