ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.Will Asynchronous email will be sent even after Web Page is closed in ASP.Net?<p>Hi,</p> <p>I'd like a suggestion, I read this good Article:</p> <p><a href=""></a></p> <p>My Req. is after some event (ie click button) start send email process, but I'd like that user can close also the webpage without waiting the response of sending email.</p> <p>How can I do this, working with webservice or ?</p> <p>Tks&nbsp;</p> <p>Br\Vincenzo</p>, 20 Oct 2015 05:13:21 GMTWhat FaultContract in WCF?<p>Hi</p> <p>I am having small clarification in Message and Fault Contract.</p> <p>fault contract is mainly used to handle the exception that happened in service to the consumer of the service. In other words it is used to customize the message in the service and send it to the consumer.</p> <p>My doubt is that why should i go for FaultContract. I can use MessageContract or Even i can put some datamember in the datacontract to store the exception and send it to the application.</p> <p>Hope this is clear. Please let me know if this is not.</p>, 06 Aug 2014 00:52:09 GMTWhat Asynchronous call in WCF<p>Hi</p> <p>can any one explain me async call in wcf. What is the advantage and how it is used in WCF</p>, 12 Aug 2014 04:23:50 GMTWeb Service vs ASP.NET Web API and implementing Web API<p>Hi,&nbsp;</p> <p>I am new to web service and Web API.</p> <p>Need to know practicle things which we can do with WEB API and not with web service, which can demonstrate, why we should prefer WEB API over WEB Serveice.</p> <p>&nbsp;</p> <p>Need example except web service using SOAP,XML etc, if any.</p>, 30 Sep 2016 02:11:08 GMTWeb Service Error: You must implement a default accessor on Newtonsoft.Json.Linq.JObject because it inherits from ICollection<p>Using Visual Studio 2010 , FrameWork 3.5, Application WebService.</p> <p>&nbsp;below is the code in web service :&nbsp;&nbsp;</p> <pre class="brush: csharp">[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public void StartActivity(JObject objData) { }</pre> <p>I am getting error just by declaring jobject as parameter (at run time) as function is void we can avoid implementation.</p> <p>Although no error if method is not a web method.</p> <p>No error in compile time, but when I run this code I got below error :&nbsp;</p> <p>You must implement a default accessor on Newtonsoft.Json.Linq.JObject because it inherits from ICollection.</p> <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p> <p>Exception Details: System.InvalidOperationException: You must implement a default accessor on Newtonsoft.Json.Linq.JObject because it inherits from ICollection.</p>, 03 Jan 2019 05:35:39 GMTWeb Service Error: Only one usage of each socket address (protocol/network address/port) is normally permitted<p>Hi i am geeting this error i hosting listner code in amazon webservice</p> <p>this is console application when i publish and run this code i got this error when i hosted this code in amazon server</p> <p>Only one usage of each socket address (protocol/network address/port) is normally permitted</p> <p>this my code help me to solve this issue</p> <pre class="brush: csharp">using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Json; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace New_Server_Listener_Code { class Program { private static string URI = &#34;xxx&#34;; private static byte[] _buffer = new byte[1024]; private static List&lt;Socket&gt; _clientSockets= new List&lt;Socket&gt;(); private static Socket _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); static void Main(string[] args) { SetupServer(); Console.ReadLine(); } private static void SetupServer() { Console.WriteLine(&#34;Setting up Server..&#34;); _serverSocket.Bind(new IPEndPoint(IPAddress.Any, 12121)); _serverSocket.Listen(1000); _serverSocket.BeginAccept(new AsyncCallback(AcceptCallback), null); } private static void AcceptCallback(IAsyncResult AR) { Socket socket = _serverSocket.EndAccept(AR); _clientSockets.Add(socket); socket.BeginReceive(_buffer, 0, _buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), socket); _serverSocket.BeginAccept(new AsyncCallback(AcceptCallback), null); } private static void ReceiveCallback(IAsyncResult AR) { Socket socket = (Socket)AR.AsyncState; int received = socket.EndReceive(AR); byte[] dataBuf = new byte[received]; Array.Copy(_buffer, dataBuf, received); String response = String.Empty; response = Encoding.ASCII.GetString(dataBuf); Console.WriteLine(&#34;Received:&#34; + response); try { using (WebClient wc = new WebClient()) { string Request = &#34;SelectionType=Request&amp;DataValue=&#34; + response + &#34;&#34;; wc.Headers[HttpRequestHeader.ContentType] = &#34;application/x-www-form-urlencoded&#34;; string HtmlResult = wc.UploadString(URI, Request); var json = JsonObject.Parse(HtmlResult); } } catch (WebException ex) { Console.WriteLine(ex); } } } }</pre> <p>&nbsp;</p>, 31 Jan 2018 00:50:21 GMTweb project C# run correctly on my system but it runs another system that time design change<p>web project in c# working properly on my system(Computer), but this project run on another syatem that time web page design will be change.</p> <p>web page design in the with &nbsp;css.</p> <p>what can i do for solve this issue ?</p>, 20 May 2016 01:43:08 GMTWeb page displaying Empty Pie Chart for dynamic values in ASP.Net<p>i dynamically set the value in pie chart My code as follows</p> <pre class="brush: csharp">&lt;asp:PieChart ID=&#34;PieChart1&#34; runat=&#34;server&#34; ChartHeight=&#34;300&#34; ChartWidth=&#34;450&#34; ChartTitle=&#34;Today&#39;s Attendance&#34; ChartTitleColor=&#34;#0E426C&#34;&gt; &lt;piechartvalues&gt; &lt;asp:PieChartValue Category=&#34;Present&#34; Data=&#34;80&#34; /&gt; &lt;asp:PieChartValue Category=&#34;Absent&#34; Data=&#34;10&#34; /&gt; &lt;asp:PieChartValue Category=&#34;Leave&#34; Data=&#34;10&#34; /&gt; </pre> <p>when i run the above code shows the empty pie chart. what is the mistake in my above code.</p>, 16 Jan 2018 00:14:59 GMTWCF JSON Rest Service Select Insert Update Delete (CRUD) in C# and VB.Net<p>hello,&nbsp;</p> <p>i am using this snippet for user login</p> <p><a href=""></a></p> <p>it works fine, what i want is, i want to convert all methods in user.cs file convert into JSON api so i can use the same logic in android app.</p> <p>how to make REST API for insert update and delete.</p>, 11 Nov 2018 23:23:41 GMTWCF Error: The configuration section system.web.extensions cannot be read because it is missing a section declaration<p>Hi,</p> <p>I have WCF Service Project which is in .NET version 3.5 (VS2008) and the running pool is Classic .NET App pool, to Upgrade to .NET version 4.0, Project Migrated to VS2010, then in IIS Manager when Classic .NET App pool was selected there is an Error message while opening "Directory Browsing". the Error Message is adding below</p> <p>"<strong>The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration</strong>"</p> <p>The Error Message is not appearing when selected any other App pool.</p> <p>after Upgradation is it necessary to change app pool to ASP.NET v4.0 Classic .NET AppPool or Some other.<br />anyway i tried every App pool. when selected App pool ASP.NET v4.0 Classic .NET AppPool , while browsing .svc file the following Error is displaying</p> <p>"<img src="/home/mjsoft/Pictures/Screenshot from 2018-09-13 13-47-09.png" alt="Screenshot of browser when APP POOL is &quot;ASP.NET v4.0 Classic .NET AppPool&quot;" />". </p>, 14 Sep 2018 00:05:28 GMTSend http web request without waiting for response in ASP.Net<p><br />How to send http request in without waiting for a response and without tying up resources and other page events should work properly ?</p>, 06 Nov 2017 00:24:38 GMTSend email using web application like Contact Us page in ASP.Net<p>how can the user send their requirement via email using my web application in must send mail to the mail account which associated with a Gmail account in my site......</p> <p>Dear i have a site ...on my site, there is three textbox&nbsp;</p> <p>1."From" in this box user need to write his mail id.</p> <p>2."Subject" what he/she is going to send me&nbsp;</p> <p>3. "Message Box"</p> <p>4.And a button called "Send"</p> <p>user type their mail id , subject and message and then user click on the button and the mail will come to my email is which is attached&nbsp;to my site</p> <p>&nbsp;</p>, 20 Jul 2016 03:52:15 GMTSecurely calling Web API using C# in ASP.Net<p>Dear Sir,</p> <p>Please suggest&nbsp;How to create registration page API to send data on specific domain or IP address in secure layer.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>Thanks.</p>, 06 Feb 2018 01:47:43 GMTWCF Error: Could not find default endpoint element that references contract<p> Client side Code 1. I have created web application and added service reference to the Client Project 2. I tried creating a client Object like this -</p> <p>Service1Client a = new Service1Client();</p> <p>but getting an error message :- Could not find default endpoint element that references contract 'ServiceReference_test.IService1' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.</p> <p> Could you please let me know what mistake am doing, I am new to WCF please help me</p> <pre class="brush: csharp">===============WCF service which returns JSON Format =============== namespace WcfService1 { // NOTE: You can use the &#34;Rename&#34; command on the &#34;Refactor&#34; menu to change the class name &#34;Service1&#34; in code, svc and config file together. // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging. public class Service1 : IService1 { public string GetData(string Id) { return (&#34;You entered: &#34; + Id); } } } ==================== namespace WcfService1 { [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke(Method = &#34;GET&#34;, UriTemplate = &#34;/GetData/{Id}&#34;, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped )] string GetData(string Id); // TODO: Add your service operations here } } ====================Web.Config file ========= &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name=&#34;WcfService1.Service1&#34; behaviorConfiguration=&#34;ServiceBehaviour&#34;&gt; &lt;endpoint address=&#34;&#34; behaviorConfiguration=&#34;web&#34; binding=&#34;webHttpBinding&#34; contract=&#34;WcfService1.IService1&#34;/&gt; &lt;endpoint contract=&#34;IMetadataExchange&#34; binding=&#34;mexHttpBinding&#34; address=&#34;mex&#34;/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name=&#34;web&#34;&gt; &lt;webHttp helpEnabled=&#34;true&#34; automaticFormatSelectionEnabled=&#34;false&#34; /&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name=&#34;ServiceBehaviour&#34;&gt; &lt;serviceMetadata httpGetEnabled=&#34;true&#34; httpsGetEnabled=&#34;true&#34;/&gt; &lt;serviceDebug includeExceptionDetailInFaults=&#34;false&#34;/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;!--&lt;protocolMapping&gt; &lt;add binding=&#34;basicHttpsBinding&#34; scheme=&#34;https&#34; /&gt; &lt;/protocolMapping&gt;--&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&#34;true&#34; multipleSiteBindingsEnabled=&#34;true&#34; /&gt; &lt;/system.serviceModel&gt; </pre> <p>&nbsp;</p>, 20 Feb 2018 23:02:11 GMTWCF Error Failed to update Service Reference 'WCFService.Reference' There was an error downloading<p>Error1Failed to update Service Reference 'SecurityWCFService.Reference'.Error:There was an error downloading 'http://localhost/SecServiceSite/Service.svc'.The request failed with HTTP status 404: Not Found.Metadata contains a reference that cannot be resolved: 'http://localhost/SecServiceSite/Service.svc'.There was no endpoint listening at http://localhost/SecServiceSite/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.The remote server returned an error: (404) Not Found.(0x80131509)file:///D:/Ram/rajesh/New Folder (2)/Intranet/myAsmara/App_WebReferences/SecurityWCFService/Reference.svcmapD:\...\myAsmara\</p>, 13 Oct 2014 01:10:18 GMTWarning: This web reference does not conform to WS-I Basic Profile v1.1. SOAP 1.1 binding was not found:<p>Hi,</p> <p>&nbsp;</p> <p>I want to create a Proxy class file from WSDL which is having Soap12 bindings style. I tried to create that using Wsdl.exe from command prompt. But i received the following error</p> <p>&nbsp;</p> <p><strong>Warning: This web reference does not conform to WS-I Basic Profile v1.1.</strong><br /><strong>SOAP 1.1 binding was not found: WS-I's Basic Profile 1.1 consists of implementat</strong><br /><strong>ion guidelines that recommend how a set of core Web services specifications shou</strong><br /><strong>ld be used together to develop interoperable Web services. For the 1.1 Profile,</strong><br /><strong>those specifications are SOAP 1.1, WSDL 1.1, UDDI 2.0, XML 1.0 and XML Schema.</strong></p> <p><strong>For more details on the WS-I Basic Profile v1.1, see the specification</strong><br /><strong>at</strong></p> <p><strong>Warning: one or more bindings were skipped.</strong><br /><strong>Warnings were encountered. Review generated source comments for more details.</strong></p> <p><strong><br /></strong></p> <p><strong>so i couldn't create the class file. Please help</strong></p> <p>&nbsp;</p>, 26 Feb 2014 09:24:36 GMTValidation of viewstate MAC failed. If hosted by a Web Farm or cluster<p>I have a web form that I published it. and sometimes when I use it,<span class="tlid-translation translation"><span title=""> I will encounter this error:</span></span></p> <p><span class="tlid-translation translation"><span title=""><img src="" alt="" width="1508" height="848" /></span></span></p> <p><span class="tlid-translation translation"><span title="">but I do not know why<br /></span></span></p> <p>&nbsp;</p>, 05 Feb 2019 00:46:02 GMTUse HttpContext.Current in WCF Service<p>I have created an WCF service for client in However the Response is not getting from POst method. Below is the code snippet:</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: csharp">public void Post() { System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.Write(&#34;&lt;html&gt;&lt;head&gt;&#34;); System.Web.HttpContext.Current.Response.Write(string.Format(&#34;&lt;/head&gt;&lt;body onload=\&#34;document.{0}.submit()\&#34;&gt;&#34;, FormName)); System.Web.HttpContext.Current.Response.Write(string.Format(&#34;&lt;form name=\&#34;{0}\&#34; method=\&#34;{1}\&#34; action=\&#34;{2}\&#34; &gt;&#34;, FormName, Method, Url)); for (int i = 0; i &lt; Inputs.Keys.Count; i++) { System.Web.HttpContext.Current.Response.Write(string.Format(&#34;&lt;input name=\&#34;{0}\&#34; type=\&#34;hidden\&#34; value=\&#34;{1}\&#34;&gt;&#34;, Inputs.Keys[i], Inputs[Inputs.Keys[i]])); } System.Web.HttpContext.Current.Response.Write(&#34;&lt;/form&gt;&#34;); System.Web.HttpContext.Current.Response.Write(&#34;&lt;/body&gt;&lt;/html&gt;&#34;); System.Web.HttpContext.Current.Response.End(); } </pre> <p>&nbsp;</p>, 22 Jun 2015 07:23:35 GMTUrl Rewrite Rule not working with multiple parameters in ASP.Net<p>Dear Sir I Have More than one url With Querystrings And I Want to Url Rewrite For Such A Standared Format Application.&nbsp;</p> <p>So I Make Many Rules For Such Url Rewriting Dynamic. </p> <p>localhost/profile.aspx?inst_id=3052&amp;course_id=&amp;course=true</p> <p>Courses/3052/Info/True</p> <p>its Working Good.</p> <pre class="brush: csharp">&lt;rule name=&#34;rule3&#34; stopProcessing=&#34;true&#34;&gt; &lt;match url=&#34;Courses/([0-9]+)/([_0-9a-z-]+)/([_0-9a-z-]+)&#34; /&gt; &lt;action type=&#34;Rewrite&#34; url=&#34;profile.aspx?inst_id={R:1}&amp;amp;course_id={R:2}&amp;amp;course={R:3}&#34; /&gt; &lt;/rule&gt;</pre> <p>But Second Url :</p> <p>localhost/profile.aspx?inst_id=3052&amp;course_id=&amp;photos=true</p> <p>Photo/3052/Images/True</p> <p>this is not working&nbsp;</p> <pre class="brush: csharp">&lt;rule name=&#34;rule4&#34; stopProcessing=&#34;true&#34;&gt; &lt;match url=&#34;Photo/([0-9]+)/([_0-9a-z-]+)/([_0-9a-z-]+)&#34; /&gt; &lt;action type=&#34;Rewrite&#34; url=&#34;profile.aspx?inst_id={R:1}&amp;amp;admission={R:2}&amp;amp;admission={R:3}&#34; /&gt; &lt;/rule&gt;</pre> <p>please tell me how to do for both</p> <p>thanks in advanced</p> <p>&nbsp;</p>, 24 Jan 2018 05:10:04 GMTUpload file using AngularJS and ASP.Net Core Web API<p>I am uploading files but not working with core web api.</p> <p>How to upload file using web api core and angular</p> <pre class="brush: csharp">var fileds = HttpContext.Request.Form.Files; string folderName = &#34;images&#34;; string webRootPath = _hostingEnvironment.WebRootPath; string newPath = Path.Combine(webRootPath, folderName); if (!Directory.Exists(newPath)) { Directory.CreateDirectory(newPath); } for (int i = 0; i &lt; Request.Form.Files.Count; i++) { var myFile = Request.Form.Files[i]; if (myFile.Length &gt; 0) { string fileName = ContentDispositionHeaderValue.Parse(myFile.ContentDisposition).FileName.Trim(&#39;&#34;&#39;); string fullPath = Path.Combine(newPath, fileName); using (var stream = new FileStream(fullPath, FileMode.Create)) { myFile.CopyTo(stream); } } }</pre> <p>&nbsp;</p> <p>&nbsp;</p>, 31 Aug 2018 23:23:54 GMT