asp.net-4.0

Paging by using dynamically created html table

戏子无情 提交于 2019-12-13 04:09:18
问题 I am coding online sales for a website. I have a problem on my main page where I would like to show products. I defined a table with 4 columns, but there are over than a 100 products and I need paging for that. How can I implement paging with 20 products per page? 回答1: There are a lot of finished controls that will help you on the way, check this MSDN Article out: Creating a Pager Control for ASP.NET You could also check out one of the many jQuery Pagers out there, however if you use the

Get binary from uploaded file (image) in ASP.NET MVC

吃可爱长大的小学妹 提交于 2019-12-13 03:46:25
问题 I'm using the following code: <form action="" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <input type="submit" /> </form> And... [HttpPost] public ActionResult Index(HttpPostedFileBase file) { if (file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName); file.SaveAs(path); } return RedirectToAction("Index"); } Instead of

Best practices and tools for improving web server's performance in asp.net mvc?

烈酒焚心 提交于 2019-12-13 03:08:27
问题 Before the question here is what we tried to test the performance website. We simulated 80 users simultaneously on the website using JMeter. So, I am working on database issues and other problem. But one of the problems was the web server performance was not good and it was maxing out. So , I am in the process of improving the web server's performance and have downloaded Redgate Performance profiler and also dottrace. I was going to get into using these but I before that I thought of asking

How to disable HTML tag validation on a specific TextBox?

主宰稳场 提交于 2019-12-13 02:05:39
问题 I have a form where one of the fields would allow entry of HTML tags. <asp:TextBox ID="someID" runat="server" TextMode="MultiLine" /> In this field I have a RequiredFieldValidator validation only. Unfortunately, after any PostBack if the content of any of the fields includes HTML tags or any other potentially dangerous code - the entire ViewState is cleaned. Setting ValidateRequest to false does not help. I'm using IIS 7.5 and .NET 4.0. Any ideas? 回答1: You also need to set the <system.web>

IIS7 App Pool can't load library with Fixed Base Address

北战南征 提交于 2019-12-12 14:30:22
问题 My .NET 4.0 Web services are using libeay32.dll, which is compiled in VS2010 with the /FIXED option in order to be FIPS compliant. This means that libeay32.dll fails to load unless it gets to live in a certain address (0xfb00000). The exception thrown is: System.DllNotFoundException: Unable to load DLL 'some_dependent_library.dll': Attempt to access invalid address. The only way I know to help guarantee that libeay32.dll gets the right address is to load it in a Main() method before any other

Adding User Controls from code behind [duplicate]

北城以北 提交于 2019-12-12 12:23:52
问题 This question already has an answer here : ASP.NET Custom user control to add dynamically (1 answer) Closed 2 years ago . I have a user control( UserControl1 ) on my page and one Add more button.Clicking on Add More Button add the same user control again.When i click on user control first time,it adds second User Control,but on second time it doesnot add other.I think the control gets lost. I am adding a control like this on link button click:- protected void lnkadd_Click(object sender,

AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced

假如想象 提交于 2019-12-12 10:58:54
问题 Recently I started working on VS2010 and I am referencing AjaxControlToolkit 4.1.51116.0. I am getting below runtime error - Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll. I have seen many question floating for same error but the solution suggested is to use 'ToolkitScriptManager' instead of

Precompile a asp.net4 mvc3 website using visual studio 2010

不羁岁月 提交于 2019-12-12 07:12:36
问题 What is the best way to pre-compile a asp.net4 mvc3 website with all its view files using visual studio 2010? I'm a little confused because MS provides multiple solutions that sound very similar. Web Deployment Projects http://blogs.msdn.com/b/webdevtools/archive/2010/05/26/visual-studio-2010-web-deployment-projects-rtw-available-now.aspx Web Deployment Tool http://www.microsoft.com/download/en/details.aspx?id=25230 or can I just do all this from the default VS2010 SP1 without additional

Anonymous type and getting values out side of method scope

有些话、适合烂在心里 提交于 2019-12-12 05:39:20
问题 I am building an asp.net site in .net framework 4.0, and I am stuck at the method that supposed to call a .cs class and get the query result back here is my method call and method 1: method call form aspx.cs page: helper cls = new helper(); var query = cls.GetQuery(GroupID,emailCap); 2: Method in helper class: public IQueryable<VariablesForIQueryble> GetQuery(int incomingGroupID, int incomingEmailCap) { var ctx = new some connection_Connection(); ObjectSet<Members1> members = ctx.Members11;

Shared Forms Authentication not working between .NET 3.5 and .NET 4.0 applications

孤人 提交于 2019-12-12 05:20:38
问题 I have two web applications, one running under .Net 3.5, the other has been upgraded to .Net 4.0. Prior to the upgrade, shared authentication was setup and working correctly between the two applications as indicated in the MSDN article: http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx The 3.5 Application is running under the Classic .NET AppPool (v2.0, Classic Pipeline). The 4.0 application is running under the ASP .NET v4.0 AppPool (v4.0, Integrated Pipeline). 回答1: The problem turned