ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2018 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 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 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 GMTReturn HTML response from Web Service in ASP.Net<p>I want to return html response using web service .how can i achieve this.?</p>, 03 Apr 2018 01:15:20 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 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 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 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 GMTRazor Web Pages Folder Security<p>I am able to secure the .vbhtml pages using WebSecurity and _PageStart.vbhtml; however, this does not protect other files in the folder, such as .pdf files, etc.&nbsp; How do I secure other folder items?</p>, 15 Nov 2017 02:30:58 GMTUpload image using WCF Rest WebService in ASP.Net<p>How to upload and save images as (BLOB) in databse in using WCF</p> <p>&nbsp;</p> <p>am getting images as bytes in my datatable..but returns error 400 if multiple images selected</p> <pre class="brush: csharp"> DocumentID = int.Parse(Request.QueryString[&#34;DocID&#34;]); byte[] fileData = new byte[file.InputStream.Length]; //Stream streamdata = new MemoryStream(fileData); file.InputStream.Read(fileData, 0, Convert.ToInt32(file.InputStream.Length)); file = getfile.UploadedFiles[filecnt]; if (dtImage == null || dtImage.Rows.Count == 0) { dtImage = new DataTable(); dtImage.Columns.Add(&#34;REQID&#34;); dtImage.Columns.Add(&#34;DocType&#34;); dtImage.Columns.Add(&#34;FileType&#34;); dtImage.Columns.Add(&#34;uploadId&#34;); //dtImage.Columns.Add(&#34;DATA&#34;, typeof(Byte[])); //dtImage.Columns.Add(&#34;DATAstream&#34;, typeof(Stream)); for (int i = 0; i &lt;= 0; i++) { DataRow dtrowtar = dtImage.NewRow(); dtrowtar[0] = DocumentID; dtrowtar[1] = ddlType.SelectedValue.ToString(); dtrowtar[2] = file.GetExtension().ToString(); dtrowtar[3] = 1; dtrowtar[4] = fileData; //dtrowtar[5] = streamdata; dtImage.Rows.Add(dtrowtar); } } else { int DocIndex = dtImage.Rows.Count; dtImage.Rows.Add(); dtImage.Rows[DocIndex][&#34;REQID&#34;] = dtImage.Rows[0][&#34;REQID&#34;]; dtImage.Rows[DocIndex][&#34;DocType&#34;] = ddlType.SelectedValue.ToString(); dtImage.Rows[DocIndex][&#34;FileType&#34;] = file.GetExtension().ToString(); dtImage.Rows[DocIndex][&#34;uploadId&#34;] = int.Parse(dtImage.Rows[DocIndex - 1][&#34;uploadId&#34;].ToString()) + 1; dtImage.Rows[DocIndex][&#34;Data&#34;] = fileData; //dtImage.Rows[DocIndex][&#34;DATAstream&#34;] = streamdata; } } </pre> <p>&nbsp;</p>, 03 Dec 2013 00:36:17 GMTUpload Image file using Web Service in ASP.Net<p>Hello,</p> <p>I want web service which will upload images (.jpeg, .jpg, .png) on server and this web service will call by android app, I am using web service <strong>not</strong> WCF.</p>, 01 Sep 2015 04:36:17 GMTUpload file using Web Service in ASP.Net<p>Hello,</p> <p>I have one web method and I want to upload file on server using this method please guide me how to implement it.</p>, 24 Aug 2015 04:46:21 GMTUpload file using WCF REST service in ASP.Net<p>&nbsp;</p> <p>please help me</p> <p>I need to pass uploaded image file and input data from front end to wcf via jquery ajax</p> <p>How can i save image file to server folder from wcf?</p> <p>&nbsp;</p> <p>&nbsp;</p>, 06 Dec 2017 01:22:39 GMT