Ich möchte ein Objekt Daten an einen asp.net-Handler von aspx.cs übergeben und es wird über ein anderes Projekt. Jeder Kommentar wird geschätzt.httppost zu asp net Handler
//Project A (abc.aspx.cs)
try
{
String ltq_str = new JavaScriptSerializer().Serialize(ltq);
int t = -1;
String result = Gnuse.HTTPSend("http://localhost/is/TQueueDtcsController/integrationservice?tQueueDtcslist", HttpUtility.UrlEncode(ltq_str), ref t, "GET");
if (!result.Equals("success"))
{
GRN.delete(Convert.ToInt32(hfId.Value), false);
lblError.Text = "Inventory integration failed: " + result;
}
}
Für Projekt B (TQueueDtcsController.cs)
public ActionResult integrationservice(String tQueueDtcslist)
{
try
{
List<TQueueDtcIntegration> ListOftQueueDtc = JsonConvert.DeserializeObject<List<TQueueDtcIntegration>>(tQueueDtcslist);
// String[] value_arr = tQueueDtc.ProductName.Split(new char[] { '-' });
if (ListOftQueueDtc.Count() <=0)
{ return Content("list is empty", "application/text"); }
foreach (TQueueDtcIntegration tQueueDtcint in ListOftQueueDtc)
{
//performed some thing
}
}
Handler sind spezifisch für Erweiterungen. ASP.NET hat bereits eine Registrierung für '.aspx'. –