با سلام
من دارم یه وب سرویسی می نویسم که کاربر اطلاعات رو میفرسته و من باید این اطلاعات و همچنین کاربر رو به یک سایت دیگر بفرستم .
NameValueCollection collections = new NameValueCollection(); collections.Add("id", resultArray[1]); string remoteUrl = "http://www.otherwe.com"; string html = "<html><head>"; html += "</head><body onload='document.forms[0].submit()'>"; html += string.Format("<form name='PostForm' method='POST' target='_self' action='{0}'>", remoteUrl); foreach (string key in collections.Keys) { html += string.Format("<input name='{0}' type='text' value='{1}'>", key, collections[key]); } html += "</form></body></html>"; HttpResponse Response = HttpContext.Current.Response; Response.Clear(); Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1"); Response.HeaderEncoding = Encoding.GetEncoding("ISO-8859-1"); Response.Charset = "ISO-8859-1"; Response.Write(html); Response.End();
ولی به من خطای زیر و میده :
در Web.Config کد زیر را قرار دهید و تست کنید
<httpRuntime requestValidationMode="2.0" />
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)