Value cannot be null. Parameter name: String Line: int echo = Int32.Parse(Request.Params["sEcho"]
Value cannot be null. Parameter name: String Line: int echo = Int32.Parse(Request.Params["sEcho"]
jaspreetsingh
Posts: 13Questions: 0Answers: 0
Hi guys i am trying to implement solution given in below link:
http://datatables.net/forums/discussion/6678/serverside-processing-for-asp.net-c-with-sql-server/p1
When i try to run the code i am getting the error:
on line of code:
Code behind of Default.aspx page:
protected void Page_Load(object sender, EventArgs e)
{
int echo = Int32.Parse(Request.Params["sEcho"]); // here i got error : value can not be null
int displayLength = Int32.Parse(Request.Params["iDisplayLength"]);
int displayStart = Int32.Parse(Request.Params["iDisplayStart"]);
}
You can check the entire code in above link:
aspx is:
$(document).ready(function () {
$('#grid').dataTable({
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "Default.aspx"
});
});
Edit:
I have given values of above three variables Manually :
int echo =1; // here i got error : value can not be null
int displayLength = 10;
int displayStart =0;
Now i am getting the error:
Json data from Server Could not be parsed This is caused by Json formatting error.
Below is my Json:
{"sEcho": 1,"iTotalRecords": 33,"iTotalDisplayRecords": 33,"aaData": [["Gecko","Firefox 1.0","Win 98+ / OSX.2+","1.7","A"],["Gecko","Firefox 1.5","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 2.0","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 3.0","Win 2k+ / OSX.3+","1.9","A"],["Gecko","Camino 1.0","OSX.2+","1.8","A"],["Gecko","Camino 1.5","OSX.3+","1.8","A"],["Gecko","Netscape 7.2","Win 95+ / Mac OS 8.6-9.2","1.7","A"],["Gecko","Netscape Browser 8","Win 98SE+","1.7","A"],["Gecko","Netscape Navigator 9","Win 98+ / OSX.2+","1.8","A"],["Gecko","Mozilla 1.0","Win 95+ / OSX.1+","1","A"]]}
Please help me to resolve the issue.
Thanks
http://datatables.net/forums/discussion/6678/serverside-processing-for-asp.net-c-with-sql-server/p1
When i try to run the code i am getting the error:
on line of code:
Code behind of Default.aspx page:
protected void Page_Load(object sender, EventArgs e)
{
int echo = Int32.Parse(Request.Params["sEcho"]); // here i got error : value can not be null
int displayLength = Int32.Parse(Request.Params["iDisplayLength"]);
int displayStart = Int32.Parse(Request.Params["iDisplayStart"]);
}
You can check the entire code in above link:
aspx is:
$(document).ready(function () {
$('#grid').dataTable({
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "Default.aspx"
});
});
Edit:
I have given values of above three variables Manually :
int echo =1; // here i got error : value can not be null
int displayLength = 10;
int displayStart =0;
Now i am getting the error:
Json data from Server Could not be parsed This is caused by Json formatting error.
Below is my Json:
{"sEcho": 1,"iTotalRecords": 33,"iTotalDisplayRecords": 33,"aaData": [["Gecko","Firefox 1.0","Win 98+ / OSX.2+","1.7","A"],["Gecko","Firefox 1.5","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 2.0","Win 98+ / OSX.2+","1.8","A"],["Gecko","Firefox 3.0","Win 2k+ / OSX.3+","1.9","A"],["Gecko","Camino 1.0","OSX.2+","1.8","A"],["Gecko","Camino 1.5","OSX.3+","1.8","A"],["Gecko","Netscape 7.2","Win 95+ / Mac OS 8.6-9.2","1.7","A"],["Gecko","Netscape Browser 8","Win 98SE+","1.7","A"],["Gecko","Netscape Navigator 9","Win 98+ / OSX.2+","1.8","A"],["Gecko","Mozilla 1.0","Win 95+ / OSX.1+","1","A"]]}
Please help me to resolve the issue.
Thanks
This discussion has been closed.
Replies
Allan
Thanks allan for your reply...
I am able to use Server Side Processing as described in below link for first time -:) :
http://datatables.net/forums/discussion/6678/serverside-processing-for-asp.net-c-with-sql-server/p1
Only issue:
If while searching , it's not able to find anything then it throws error on line:
outputJson = outputJson.Remove(outputJson.Length - 1);
Line 113 of above link as outputJson is coming "" (blank) as no record found.
I want to display custom message in datatables that "No records found".
Guys please help i am almost close to closing the deal -:).
Thanks
For "no records found" DataTables requires all of the information as usual (iDisplayRecords etc) with aaData as an empty array.
Allan
Do i need to pass it explicitly?.
Gud thing is atleast i am able to use Jquery Data Tables now !!!
I don't understand - you just need to give it an empty array (i.e. [], plus the other parameters required, iDisplayRecords, etc). What does your JSON return for this case look like? It might be worth comparing it to that in my demos.
Allan