Mvc
Add to
Roche.Models.Logincodes per = new Roche.Models.Logincodes ();
Per. QRCode = data. QRCode;
Per. Count = Adminid;
Dd.Logincodes.InsertOnSubmit (per);
Dd.submitchanges ();
Modify
using (var db = new Runhuayoumodeldatacontext ())
{
var Amodel = Db.admin.Where (b = B.adminid = = Adminid). Singleordefault ();
Amodel.password = Psmodel. NewPassword1;
Db. SubmitChanges ();
}
Delete
Dd.executecommand (String. Format ("Delete from Brand where ID in ({0})", String. Join (",", Deleteid))); It is recommended to use this
var coming = Db.Comings.Find (ID);
Db.Comings.Remove (coming);
Db.savechanges ();
-------------------------------------------
using (var db = new Runhuayoumodeldatacontext ())
{
var Amodel = Db.admin.Where (b = B.adminid = = Adminid). Singleordefault ();
Amodel.password = Psmodel. NewPassword1;
Db. SubmitChanges ();
}
Lambda-expression
N.name.startswith (Name)--equivalent to a%
N.name.endswith (Name)--equivalent to%a
N.name.indexof (Name)!=-1--equivalent to%a%
. Names.contains (amodel.names)--equivalent to%a%
A label pass value
<a href= "/home/[email protected]" >
var idstr = request["Text_" + item]; background Gets the value labeled Text_
@Html. hiddenfor (b = b.id)//Hidden text
--------------------------------------------------------------------------------------------------------------- -----------This belongs to one inside
Front desk @Html. Validationmessage ("Tip")
Background modelstate.addmodelerror ("Tip", "Login Error");
*[allowhtml]* This is the main
public string content {get; set;} The upload added in the model
Public HttpPostedFileBase caseimg {get; set;} -This is what the text editor must use in the model
@using (Html.BeginForm ("views", "Controllers", FormMethod.Post, new {enctype = "multipart/form-data"}))
{
@Html. textboxfor (b + = B.spic, new {type = "file", @class = "Text-input medium-input"})//This is the upload foreground code
}
--------------------------------------------------------------------------------------------------------------- ----------------
@Html. dropdownlistfor (b = b.newstype, (selectlist) viewbag.newslist, new {@class = "Personselecter02"})//This is a drop-down box
--------------------------------------------------------------------------------------------------------------- ----------------
<script> Store Numbers
function Checknum () {
if ((Event.keycode < | | Event.keycode > $) && (Event.keycode! = 88))
Event.returnvalue = false;
}
</script>
--------------------------------------------------------------------------------------------------------------- ----------------
[Required (errormessage = "* Enter your e-mail address")]mvc the properties inside the model
[RegularExpression (@ "[A-za-z0-9._%+-][email protected][a-za-z0-9]+\.[ a-za-z]{2,4} ", errormessage =" *{0} is not properly formatted ")]
==============================================================================================
<input type= "button" value= "return" onclick= "Javascript:history.go ( -1)" >//return
After the project is loaded Error--------------------------------------------------------------------------------------------------------------------
Workaround
http://blog.csdn.net/sat472291519/article/details/17246247
The COM component is named Microsoft Internet Controls. Add a reference to the following add references->com tab-> Microsoft Internet Controls
. NET tab->microsoft.mshtml
-------------------------------------This is the text editor URL------
http://kindeditor.net/
---------------------------------------------------------Methods in MVC
Comparison of ActionResult and sub-categories
Description of the subclass name of the ActionResult
Viewresult represents the HTML page content
Emptyresult indicates blank page content
Redirectresult means to navigate to a different URL
Jsonresult indicates that JSON results can be applied to Ajax programs
Javascriptresult represents a JavaScript object
Contentresult represents a textual content
Filecontentresult represents a file that can be downloaded, binary content
Filepathresult represents a file that can be downloaded with a specified path
Filestreamresult represents a downloadable, streaming file
MVC Knowledge Application