Click here to Skip to main content
15,891,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an
<a id="y1">1 </a> <a id="y2">2</a>
in a page.I need to access it in the controller page. How can I do it?

I tried like this:

C#
[HttpPost]
public ActionResult Event(FormCollection form)
{           
  form.GetValue("y1");          
  return View();       
}


But I am getting null value.
Posted
Updated 15-Nov-10 22:42pm
v8
Comments
deepak thomas 16-Nov-10 4:17am    
no
Dalek Dave 16-Nov-10 4:43am    
Edited for Readability and Code Block.

hi,
just pass the identity as query string then u can identify the clicked link..
 
Share this answer
 
Have a look at this link for some good tips on this:

http://odetocode.com/blogs/scott/archive/2009/04/27/6-tips-for-asp-net-mvc-model-binding.aspx[^]

Good luck!
 
Share this answer
 
Comments
deepak thomas 16-Nov-10 4:36am    
tried like form["y1"].but got this error Object reference not set to an instance of an object.

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