1. Stored procedure returns the number of rows affected
SET NOCOUNT OFF
The method of calling the BLL layer in a 2.aspx background file even if it is a static method, you need to instantiate the object Xxbll b=new xxbll (); otherwise, an error occurred that the object reference was not set to the object instance, and it was in the DAL. (For a whole day, I thought it was the Ajax method or the background Dal layer was wrong, but I still don't know why).
3. Regardless of the height of the page, the footer remains at the bottom of the page
HTML, body {margin:0; padding:0; height:100%;}
#container {min-height:100%; position:relative;}
#body {padding-bottom:60px;/* Height of the footer this is critical */}
#footer {position:absolute; bottom:0; width:100%; height:60px;/* height of the footer this is critical */}
<div id= "container" ><div id= "Body" ></div><div id= "Footer" ></div></div>
The
4.jquery $.post () method handles JSON data coming from the background
$.post ("/handler.ashx", {command: "Getmedtosend", Medname:MedName.val (). Trim ()}, function (res) {
Alert (res);
res = $.parsejson (res);//Convert JSON to JQ object
T = "";
$.each (res, function (I, item) {
T + = "<tr>";
T + = "<td>" + item. Medid + "</td>";
T + = "<td>" + item. Medname + "</td>";
T + = "<td>" + item. unit+ "</td>";
T + = "<td>" + item. Form + "</td>";
T + = "<td>" + item. Specification + "</td>";
T + = "<td>" + item. Producer + "</td>";
T + = "<td>" + item. Type + "</td>";
T + = "<td>" + item. Price + "</td>";
T + = "<td>" + item. Num + "</td>";
T + = "<td>" + item. Instockid + "</td>";
T + = "</tr>";
});
$ ("#table"). empty ();
$ ("#table"). Append (t);
});
This is to show the data by attaching it to a table, but note the item in the $.each method. field name, this field name must be the same as the database out of the queried field name, otherwise the table data is displayed as undefined.
5. According to TR to obtain TD, various access
Multiplication in 6.jQuery, addition
var a=123;var b=123; var s=a+b; This is the sum of the strings, to add the numbers: Var s=a*1+b*1;
The format of the 7.$ (ID variable name) is $ ("#" + variable name)
JSON date format conversion in 8.jQuery
function ToDate (jsondate) {
Jsondate = Jsondate.replace ("/date (", ""). Replace (")/", "");
if (Jsondate.indexof ("+") > 0) {
Jsondate = jsondate.substring (0, Jsondate.indexof ("+"));
}
else if (Jsondate.indexof ("-") > 0) {
Jsondate = jsondate.substring (0, Jsondate.indexof ("-"));
}
var date = new Date (parseint (Jsondate, 10));
var month = Date.getmonth () + 1 < 10? "0" + (date.getmonth () + 1): Date.getmonth () + 1;
var currentdate = date.getdate () < 10? "0" + date.getdate (): Date.getdate ();
var hours = date.gethours () < 10? "0" + date.gethours (): Date.gethours ();
var minutes = Date.getminutes () < 10? "0" + date.getminutes (): Date.getminutes ();
var seconds = date.getseconds () < 10? "0" + date.getseconds (): Date.getseconds ();
Return Date.getfullyear ()
+ "Year"
+ Month
+ "Month"
+ currentdate
+ "Day"
+ " "
+ hours
+ ":"
+ minutes
+ ":"
+ seconds;
}
Detailed summary of the development of bi-set