public ActionResult YourView(int id) { var model = new YourModel(); var image = db.GetImage(id); model.Id = id; model.ImageB64 = String.Format("data:image/png;base64,{0}", Convert.ToBase64String(image)); }
//---- sign up for events public void Subscribe(YourModel model) { model.evtDataChanged += new YourModel.DataChangedDelegate(DataChangedHandler); }
public YourViewModel(YourModel model) { this.model = model; this.model.OnItemAdded += item => this.foldersToScan.Add(item); }
public ActionResult PostMethod() { YourModel model = new YourModel(); return(View(model)); }
public ActionResult PostMethod(YourModel model) { //Do something with model.MyText; System.Threading.Thread.Sleep(5000); return(Json("And We're Done")); }
public ActionResult Submit(YourModel model) { var csvData = model.Table.ToCsv(); // assuming you have this method already since it's in your code above // Do something with the data and return a view }
public void GetChart() { YourModel model = new YourModel(); _view.ChartControl = model.GenerateChart(); }
public ViewResult Index() { YourModel model = db.LoadData(); return(View(model)); }