Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am generating anchor tag in code behind.

C#
lblM.Text = "<a önclick="WANT TO CALL CODEBEHIND FUNCTION" />My Link</a>


this will be label text. I want to call code behind function on click of this link.

How to write/call it from onclick of anchor tag?


Thanks
Posted
Updated 11-Jul-13 20:08pm
v2

1 solution

 
Share this answer
 
Comments
PleaseHelpCP 12-Jul-13 2:27am    
thanks Naz_Firdouse for your solution. i have already tried with pagemethods. but its giving following error

The server method 'fncheck' failed with the following error: System.NullReferenceException-- Object reference not set to an instance of an object.
Naz_Firdouse 12-Jul-13 2:29am    
can you post your server code as well

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