asp.net-3.5

Multiple Calls to the same Web Service Blocking?

主宰稳场 提交于 2019-11-27 16:21:58
问题 We have a page that makes a request to a 3'rd party web service. When under heavy load this response time extends significantly, however the 3'rd party reports back that there times for processing remains constant. There timings show that from the time they receive a request to the time they send it back is always around 1.5-2.0 seconds. Now we are experiencing wait times of over 20 seconds. My understanding of ASP.NET is that each request will run on a IIS thread pool thread and make the

Create Text File Without BOM

久未见 提交于 2019-11-27 12:33:39
I tried this aproach without any success the code I'm using: // File name String filename = String.Format("{0:ddMMyyHHmm}", dtFileCreated); String filePath = Path.Combine(Server.MapPath("App_Data"), filename + ".txt"); // Process myObject pbs = new myObject(); pbs.GenerateFile(); // pbs.GeneratedFile is a StringBuilder object // Save file Encoding utf8WithoutBom = new UTF8Encoding(true); TextWriter tw = new StreamWriter(filePath, false, utf8WithoutBom); foreach (string s in pbs.GeneratedFile.ToArray()) tw.WriteLine(s); tw.Close(); // Push Generated File into Client Response.Clear(); Response

Making a short URL similar to TinyURL.com

旧街凉风 提交于 2019-11-27 12:29:50
问题 I'm building a new web app that has a requirement to generate an internal short URL to be used in the future for users to easily get back to a specific page which has a very long URL. My initial thoughts are to store a number in a database and output it in a HEXADECIMAL value to keep it shorter than an integer. TinyURL.com seems to use something other than HEXADECIMAL (multiple case letters mixed with numbers). Is there an easy way to generate something similar what TinyURL does? 回答1: Please,

How the session work in asp.net?

为君一笑 提交于 2019-11-27 10:50:00
问题 Please any one suggest me how the session is actually work in asp.net? I am confuse in part of session and want to briefly knowledge of it so please guide me 回答1: ASP.NET uses a cookie to track users. When you try to write something to the session for the first time a cookie is sent to the client, something like ASP.NET_SessionId . This cookie is sent by the client on subsequent requests. Thanks to this cookie the server is able to identify the client and write/read the associated session

Any way to prevent master pages from changing element IDs?

不打扰是莪最后的温柔 提交于 2019-11-27 06:56:12
问题 I'm looking at adding master pages to an existing site but have found that once I do, the elements' IDs get prepended with a code (e.g. ctl00_MainPageContent_ ). Unforunately, this breaks existing scripts on the page that use the original, unmodified element ID. I realize that I can replace it with <%= Element.ClientID %> but it'd be awesome if I could disable this behavior altogether. So, can I keep the original IDs? 回答1: The question was already answered in the previous post: Remove

Stopping onclick from firing when onclientclick is false?

别说谁变了你拦得住时间么 提交于 2019-11-27 04:58:56
Is it possible to use the onclientclick property of a button to do a clientside check. If the check returns true , then fire the onclick event. If the clientside check returns false , don't fire the onclick event. Is that possible? UPDATE: These 2 work: Stops the form from submitting: OnClientClick="return false;" Allows the form to submit: OnClientClick="return true;" The next 2 do not work: // in js script tag function mycheck() { return false; } // in asp:button tag OnClientClick="return mycheck();" // in js script tag function mycheck() { return true; } // in asp:button tag OnClientClick=

How to make update panel in ASP.NET MVC

可紊 提交于 2019-11-27 04:58:20
问题 How do I make an update panel in the ASP.NET Model-View-Contoller (MVC) framework? 回答1: You could use a partial view in ASP.NET MVC to get similar behavior. The partial view can still build the HTML on the server, and you just need to plug the HTML into the proper location (in fact, the MVC Ajax helpers can set this up for you if you are willing to include the MSFT Ajax libraries). In the main view you could use the Ajax.Begin form to setup the asynch request. <% using (Ajax.BeginForm("Index"

What Causes “Internal connection fatal errors”

痴心易碎 提交于 2019-11-27 04:30:26
问题 I've got a number of ASP.Net websites (.Net v3.5) running on a server with a SQL 2000 database backend. For several months, I've been receiving seemingly random InvalidOperationExceptions with the message "Internal connection fatal error". Sometimes there's a few days in between, while other times there are multiple errors per day. The exception is not limited to one site in particular, though they share business and data access assemblies. The error seems to always be thrown from SqlClient

Create Text File Without BOM

心已入冬 提交于 2019-11-27 04:03:52
问题 I tried this aproach without any success the code I'm using: // File name String filename = String.Format("{0:ddMMyyHHmm}", dtFileCreated); String filePath = Path.Combine(Server.MapPath("App_Data"), filename + ".txt"); // Process myObject pbs = new myObject(); pbs.GenerateFile(); // pbs.GeneratedFile is a StringBuilder object // Save file Encoding utf8WithoutBom = new UTF8Encoding(true); TextWriter tw = new StreamWriter(filePath, false, utf8WithoutBom); foreach (string s in pbs.GeneratedFile

Unable to convert MySQL date/time value to System.DateTime

你说的曾经没有我的故事 提交于 2019-11-27 03:26:46
I get this error: Unable to convert MySQL date/time value to System.DateTime while I am trying to fetch the data from a MySQL database. I have the date datatype in my MySQL database. But while retrieving it into my datatable, it get the error above. How can I fix this? If I google for "Unable to convert MySQL date/time value to System.DateTime" I see numerous references to a problem accessing MySQL from Visual Studio. Is that your context? One solution suggested is: This is not a bug but expected behavior. Please check manual under connect options and set "Allow Zero Datetime" to true, as on