Friday, 6 September 2013

razor mvc4 and c# codebehind

razor mvc4 and c# codebehind

Alright, so I have just started with razor mvc4 and I have a little
experience with c#. I am currently making a website on which there is a
button. my html follows:
<button onclick ="vote1_click" id="VoteButton" value="Vote">Vote</button>
this is in a .cshtml view
I then have a class to handle the vote1_click event. It is in c# and follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MvcApplication1
{
public class voting
{
public void vote1_click(object sender, EventArgs e)
{
}
}
}
I believe that my issue is a fundamental understanding of the razor
structure, but could not figure it out on my own.
Any help at all is appreciated, and I will try to not feel too stupid when
the answer is simple.
Thanks!

No comments:

Post a Comment