Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying as like this to get job_id.Now how i will get value in code behind. I am using datalist..

ASP.NET
<asp:ImageButton name='<%#Eval("Job_ID") %>' ID="btnApply" runat="server" ImageUrl="Images/submit_btn_18.png" onclick="btnApply_Click" />
Posted
Updated 26-Aug-12 6:38am
v2
Comments
lovejaygore 26-Aug-12 10:56am    
for using Eval you are binding your datalist with dataset ok.
you have to use that dataset
can you post your code behind

1 solution

This should work:

C#
protected void btnApply_Click(object sender, EventArgs e)
{
   //assuming jobid is an integer
   int jobid = int.Parse(((ImageButton)sender).Attributes["name"]);
}


This helps you access the custom attributes you define on a control.
 
Share this answer
 

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