I Have a table in my databse that one of the columns named NumOfView shows the number of clicks on a link. That link shows some info from a row in this table. I used onclick event in anchor tag like this:
[email protected]("NumOfClicks", "AdvertiseHelper",new { id = Model.id[i] })
In NumOfClicks function I used this code
public void NumOfClicks (int id)
{
Ad ad1 = new Ad();
var advert = (from ad in storedb.Ads where ad.AdId == id select ad.NumOfView).First();
advert += 1;
}
advert
is the amount of
NumOfView
in table that I want to increase it 1 unit. but I don't know how to continue coding for update this value in table. Can anybody help me please?