물론 이것은 Visual WebGUi 게이트웨이를 사용하여 HtmlBox에 공급할 수 있습니다. HtmlBox가있는 양식이 있다고 가정하면 다음을 수행 할 수 있습니다.
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Web;
using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Common.Gateways;
using Gizmox.WebGUI.Forms;
namespace VisualWebGuiApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
NameValueCollection NVC = new NameValueCollection();
NVC.Add("JsonParm1", "value1");
NVC.Add("JsonParm2", "value2");
this.htmlBox1.Url = (new GatewayReference(this, "generateJSON", NVC)).ToString();
}
protected override Gizmox.WebGUI.Common.Interfaces.IGatewayHandler ProcessGatewayRequest(Gizmox.WebGUI.Hosting.HostContext objHostContext, string strAction)
{
if (strAction == "generateJSON")
{
// make sure no caching takes place.
objHostContext.Response.Expires = -1;
objHostContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
objHostContext.Response.CacheControl = "no-cache";
objHostContext.Response.AddHeader("Pragma", "no-cache");
// Get the parameters from the gateway reference
string strParm1 = objHostContext.Request["JsonParm1"].ToString();
string strParm2 = objHostContext.Request["JsonParm2"].ToString();
// build your output and set content type
objHostContext.Response.ContentType = "text/html";
objHostContext.Response.Write("the data you want to write");
objHostContext.Response.Flush();
return null;
}
else
return base.ProcessGatewayRequest(objHostContext, strAction);
}
}
}
실제로 게이트웨이는 실제로 VWG의 강력한 기능입니다. 이 도움이 Here
희망, 팔리을 참조
헤이 훌륭한 옵션처럼 보인다 감사 팔리어! 그냥 VWG의 고급 비트에 조금 새로운,하지만 난 다시 CSV 파일을 자동 다운로드 게이트웨이 옵션을 "해킹"않았다 .. 그냥 요청 의이 유형에 대한 연결을 만들지 않았다. 사실 "가난한"해결책은 this.htmlBox1.InvokeClientMethod ("tfrJSON", JSONdata); JSON 데이터를 tfrJSON이라는 JS 함수에 전달했습니다. 제 경우 JSON이 꽤 작지는 않습니다. 그러나 당신의 해결책을 확실히 시도 할 것이다 !! 다시 한 번 감사드립니다. –