internal void ResponseLocationPathAjax(ref byte *buffer) { AjaxStream.Reset(buffer = AutoCSer.UnmanagedPool.Default.Get(), AutoCSer.UnmanagedPool.DefaultSize); using (AjaxStream) { SetJsContentType(); bool isCallBack = ResponseAjaxCallBack(AjaxStream); if (LocationPath.ErrorPath == null) { AjaxStream.WriteNotNull(@"{""LocationPath"":"); AjaxStream.WriteJson(LocationPath.LocationPath ?? notFound404); } else { AjaxStream.WriteNotNull(@"{""ErrorPath"":"); AjaxStream.WriteJson(LocationPath.ErrorPath); if (LocationPath.ReturnPath != null) { AjaxStream.WriteNotNull(@",""ReturnPath"":"); AjaxStream.WriteJson(LocationPath.ReturnPath); } } AjaxStream.Write('}'); if (isCallBack) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void Response(ref AutoCSer.Memory.Pointer buffer) { AjaxStream.Reset(ref buffer); using (AjaxStream) { SetJsContentType(); if (ResponseAjaxCallBack(AjaxStream)) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void Response(byte *buffer) { AjaxStream.Reset(buffer, AutoCSer.UnmanagedPool.TinySize); using (AjaxStream) { SetJsContentType(); if (ResponseAjaxCallBack(AjaxStream)) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void Response <valueType>(ref valueType value, ref AutoCSer.Memory.Pointer buffer) where valueType : struct { AjaxStream.Reset(ref buffer); using (AjaxStream) { SetJsContentType(); bool isCallBack = ResponseAjaxCallBack(AjaxStream); AutoCSer.JsonSerializer.Serialize(ref value, AjaxStream, JsonSerializeConfig); if (isCallBack) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void Response <valueType>(ref valueType value, byte *buffer) where valueType : struct { AjaxStream.Reset(buffer, AutoCSer.UnmanagedPool.DefaultSize); using (AjaxStream) { SetJsContentType(); bool isCallBack = ResponseAjaxCallBack(AjaxStream); AutoCSer.Json.Serializer.Serialize(ref value, AjaxStream, JsonSerializeConfig); if (isCallBack) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void ResponseAjax(ref byte *buffer) { AjaxStream.Reset(buffer = AutoCSer.UnmanagedPool.Default.Get(), AutoCSer.UnmanagedPool.DefaultSize); using (AjaxStream) { SetJsContentType(); bool isCallBack = ResponseAjaxCallBack(AjaxStream); ajax(AjaxStream); if (isCallBack) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }
internal void ResponseAjax(ref AutoCSer.Memory.Pointer buffer) { buffer = UnmanagedPool.Default.GetPointer(); AjaxStream.Reset(ref buffer); using (AjaxStream) { SetJsContentType(); bool isCallBack = ResponseAjaxCallBack(AjaxStream); ajax(AjaxStream); if (isCallBack) { AjaxStream.Write(')'); } PageResponse.SetBody(AjaxStream, ref DomainServer.ResponseEncoding); } }