Advertisement
Advertisement
| 05.16.2008 at 07:56AM PDT, ID: 23408505 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: |
======================
AJAX CLIENT POST SCRIPT
======================// Build parameters
sParams = 'vCMS_MENU_ID=' + $('vCMS_MENU_ID').value;
sParams += '&vCMS_MENU_ITEM_ID=' + $('vCMS_MENU_ITEM_ID').value;
sParams += '&vPARENT_MENU_ITEM_ID=' + $('vPARENT_MENU_ITEM_ID').value;
sParams += '&vDISPLAY_NAME=' + $('vDISPLAY_NAME').value;
sParams += '&vCMS_PAGE_ID=' + $('vCMS_PAGE_ID').value;
sParams += '&vURL=' + $('vURL').value;
sParams += '&vORDER_NO=' + $('vORDER_NO').value;
// Save via ajax
new Ajax.Request('/ajax/menu-saveitem.asp', {
method: 'post',
parameters: sParams,
onComplete: function(transport){
var oReturn = eval("(" + transport.responseText + ")");
if (oReturn.sErrorMsg.length > 0){
// Failed
$('divAjaxStatus').update('Error: ' + oReturn.sErrorMsg).show();
}else{
// Success
gfPropertiesEditYN = false;
$('divNewRecordStatus').hide();
nCurrentMenuItemID = oReturn.nMenuItemID;
$('vCMS_MENU_ITEM_ID').value = nCurrentMenuItemID;
$('vMenuItemID').value = nCurrentMenuItemID;
$('vModifiedTS').value = new Date();
fnRefreshMenu();
$('divAjaxStatus').hide();
}
},
onFailure: function(transport){
divStatus.update('An error occurred while contacting the server. Please refresh the page.').show();
}
});
======================
AJAX SERVER SCRIPT
======================
'// Check session
sErrorMsg = fnCheckSession(true)
if len(sErrorMsg) = 0 then
nMenuID = numConvertLong(request("vCMS_MENU_ID"))
nMenuItemID = numConvertLong(request("vCMS_MENU_ITEM_ID"))
nParentMenuItemID = numConvertLong(request("vPARENT_MENU_ITEM_ID"))
sDisplayName = request("vDISPLAY_NAME")
nPageID = numConvertLong(request("vCMS_PAGE_ID"))
sURL = nz(request("vURL"), "")
nOrderNo = numConvertLong(request("vORDER_NO"))
set oConn = ConnectDB(false, sErrorMsg)
set rstTemp = server.CreateObject("ADODB.Recordset")
with rstTemp
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockBatchOptimistic
.ActiveConnection = oConn
.Open "select * from dt_CMS_MENU_ITEM where CMS_MENU_ITEM_ID = " & nMenuItemID
.Fields("CMS_MENU_ID") = nMenuID
.Fields("PARENT_MENU_ITEM_ID") = iif(nParentMenuItemID < 1, null, nParentMenuItemID)
.Fields("DISPLAY_NAME") = sDisplayName
.Fields("CMS_PAGE_ID") = nPageID
.Fields("URL") = sURL
.Fields("ORDER_NO") = nOrderNo
.updatebatch
.Close
end with
set rstTemp = nothing
if err <> 0 then sErrorMsg = err.Description
'// Create JSON return object
sBuffer = _
"{" & vbcrlf & _
" 'nMenuItemID': '" & nMenuItemID & "'," & vbcrlf & _
" 'sErrorMsg': '" & sErrorMsg & "'," & vbcrlf & _
"}" & vbcrlf
end if
response.Write sBuffer
response.end
|