asp.net-4.0

Are there any difference in using File.Copy to move a file or to write a stream to the location?

陌路散爱 提交于 2019-12-10 17:22:50
问题 I am refactoring some code an have a question that i could use a few comments on. The original code download a file to a stream. Then it writes the stream to a File in a temp directory before using File.Copy to overwrite an existing file in the production directory. Are there any benefits from writing it to the temp dir first and using the File.Copy in contrast to just writing the stream to the production directory right away? One reason could be that the File.Copy is faster then writing a

How to protect my site from session fixation?

ぐ巨炮叔叔 提交于 2019-12-10 16:36:34
问题 Currently we are facing a problem regarding session fixation. We do have one site which is secured i.e. Https and there is no authentication for it. It means it has anonymous access. So, we are facing session fixation problem from hacker. Can someone help and guide on this???? 回答1: You should find the information you need here: OWASP - information about Session Fixation Session Fixation Vulnerability in ASP.NET - Session Fixation in ASP.NET 来源: https://stackoverflow.com/questions/15021431/how

Crystal Reports toolbar is gone after upgrading from VS2008 to 2010

一个人想着一个人 提交于 2019-12-10 16:24:09
问题 I converted our web site to asp.net 4.0 in VS 2010. Crystal reports (version 10.5.3700.0) renders the reports, but the toolbar will not display (so the print/change page functionality is gone). I have set AspCompat="true" in the page that hosts the viewer, and tried just about every combination in the properties for the viewer, but the toolbar will not render. I have also tried different ClientIDModes , nothing seems to work. The only work around I have come up with so far is to set

Microsoft Chart Controls in Visual Studio 2010?

烂漫一生 提交于 2019-12-10 15:47:15
问题 Is this possible? I installed them, but they don't appear. Do I have to import them or something? 回答1: Please, take a look: How use MS chart control with VS 2010? I haven't tried it with VS2010, but I would assume the process for using it is exactly the same as described there for other versions of VS. It won't appear in the tool box until you instal the add-ons 回答2: If you cannot see the Chart control in the Toolbox, right click in the Toolbox, select Choose Items, and then select the

The following exception was thrown by the web event provider 'EventLogProvider' [closed]

雨燕双飞 提交于 2019-12-10 14:53:29
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I can't get a new ASP.NET 4.0 application to work on IIS 7, in Windows 2008 R2. All I can see in my event log is the below error. I can't seem to find any information about what it means, can anybody help? Log

What is default directory of File.Open?

妖精的绣舞 提交于 2019-12-10 14:19:23
问题 I have this code: Stream f = File.Open("data.majid", FileMode.OpenOrCreate, FileAccess.ReadWrite); Where will be file created? 回答1: From the File.Open MSDN documentation: The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory. 回答2: Usually the directory where the process was started from. This is the current working

How to avoid Page_Load() on button click?

随声附和 提交于 2019-12-10 13:34:55
问题 I have two buttons, preview and Save. With help of preview button user can view the data based on the format and then can save. But when preview is clicked, one textbox attached to ajaxcontrol (Calender) becomes empty and user have to fill the date before saving. How to handle this? On preview click i get the details to show the data in layout. <asp:TextBox ID="txtDate" ReadOnly="true" runat="server"></asp:TextBox> <div style="float: right;"> <asp:ImageButton ID="imgcalender1" runat="server"

Where is System.Web.Security.MembershipProvider?

佐手、 提交于 2019-12-10 12:28:59
问题 I have a library project that should be the base for several web applications. I am trying to implement System.Web.Security.MembershipProvider but for some reason Visual Studio cannot find it. It manages to find System.Web.Security.SqlMembershipProvider but not MembershipProvider. Any idea why? I am using Visual Studio 2010 with .NET 4. 回答1: Starting in .NET 4, MembershipProvider is declared in System.Web.ApplicationServices.dll (strangely enough), so you need to add a reference to that

What's the replacment for Microsoft.Web.Services3.dll in .NET 4.x?

偶尔善良 提交于 2019-12-10 11:24:42
问题 I have an app used Microsoft.Web.Services3 before. Now I want to move this app to .NET 4.x. What's the replacment for Microsoft.Web.Services3.dll in .NET 4.x? or I should keep the assembly Microsoft.Web.Services3.dll and the reference to it in my app even I use .NET 4.x? 回答1: You might want to consider migrating your WSE Web Services to WCF. That article says The benefits of migrating WSE 3.0 Web services to Windows Communication Foundation (WCF) include improved performance and the support

Accessing image from other server

倖福魔咒の 提交于 2019-12-10 11:20:06
问题 I have image file placed on the one server and application on other server. I want to access that image, below code I have written: On default.aspx, I have <asp:Image ID="Image1" runat="server" ImageUrl= "GetImage.aspx?imgName=MyImage.jpg" /> and on GetImage.aspx, I have written the below code on page_load protected void Page_Load(object sender, EventArgs e) { // Changing the page's content type to indicate the page is returning an image Response.ContentType = "image/jpg"; var imageName =