asp.net-4.0

Unable to Connect to the ASP.NET Development Server VS2010

懵懂的女人 提交于 2019-12-08 05:15:57
问题 I realise this question has been asked many times before and I've tried pretty much every solution out there but I still keep getting this annoying error. I've tried killing off the WebDev.WebServer40 process as suggested here. I've disabled IPv6 and my firewall, I've also looked inside my "C:\Windows\Microsoft.NET\Framework\v4.0.30319" folder for WebDev.WebServer and it doesn't exist in that directory, even when I download a fresh one and place it there it still doesn't work. All my other

Want to access literal value into javascript

随声附和 提交于 2019-12-08 04:11:11
问题 I have got a literal control on page (with some data on it). i want to access it in javascript and want to put some text on it. please tell me how can i access literal control in JavaScript. I was trying with following code- <asp:Literal ID="lblPerInstanceListing" runat="server"></asp:Literal> Javascript: var value= document.getElementById('<%=lblPerInstanceListing.ClientID %>') I am getting null value return by this. 回答1: An ASP.NET Literal control does not by itself insert any HTML into a

Two endpoint (soap ,json) and one service method

限于喜欢 提交于 2019-12-08 02:56:00
问题 I have that service [OperationContract] [WebGet(UriTemplate = "/GetData")] List<FieldInfo> GetSerializedData(); and web.config <system.web> <webServices> <protocols> <add name="HttpGet" /> <add name="HttpPost" /> </protocols> </webServices> <httpRuntime executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/> <compilation debug="true" targetFramework="4.0"/> </system.web> <system

Entity Framework Code First + MySQL… NullReferenceException

本小妞迷上赌 提交于 2019-12-08 02:11:45
问题 I need to work with data in a couple of tables in an off site MySQL database we have limited access to and decided to use it as an opportunity to pick up some EFCF experience. No matter what I do i cannot get any data out of the MySQL database. Using MySQL workbench I can confirm the connection details are correct and can access the tables necessary. Below is the current config edited a little to protect servers, etc. Web Config <connectionStrings> <clear /> <add name="foo" connectionString=

How to send list of objects to WCF service?

孤人 提交于 2019-12-07 16:41:10
问题 I'm building WCF service and I would like to accept List as a parameter to one of my method. Here is my code: [ServiceContract] public interface IProductService { [OperationContract] int InsertProducts(List<Product> products); } [DataContract] [KnownType(typeof(List<Product>))] public class Product { [DataMember] public int ProductId{ get; set; } [DataMember] public string ProductName{ get; set; } [DataMember] public List<Product> Products { get; set; } } When I run service it gives me an

Response.Redirect() vs Response.RedirectPermanent()

萝らか妹 提交于 2019-12-07 05:50:48
问题 I am new to ASP.Net 4.0, and have seen a new feature called Response.RedirectPermanent() . I have checked a few articles, but I'm unable to understand clearly the actual meaning and difference of Response.RedirectPermanent() over Response.Redirect() . According to Gunnar Peipman, Response.Redirect() returns 302 to browser meaning that asked resource is temporarily moved to other location. Permanent redirect means that browser gets 301 as response from server. In this case browser doesn’t ask

Escape Key Issues with Update Panel

北慕城南 提交于 2019-12-07 05:04:33
问题 while hitting ESC key twice when on a page containing an update panel with a any control inside, say textbox or listbox im getting a System.ArgumentException: Invalid postback or callback argument . I have checked in remaining browsers its working fine but in Internet Explorer 8 its creating above said problem. the possible solution i found, is making EnableEventValidation="false" either at page level or webconfig or disabling escape key . i dont want to go with 2 former solutions as either

After upgrading to .Net 4.0, I'm getting the exception “Could not load file or assembly 'System.Windows, Version=2.0.5.0'”

自闭症网瘾萝莉.ら 提交于 2019-12-07 03:41:40
问题 We recently upgraded our web app from 3.5 to 4.0. Now after I login and load a page with Microsoft ScriptManager on it, I get: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. It only happens the first time, reload the page and everything works. UPDATE: We have all Silverlight v4 projects.I found the System.Windows.dll in the C:\Program Files\Reference

How can I check whether with ASP.NET 4 is registered to run in IIS 7.5?

China☆狼群 提交于 2019-12-07 01:50:30
问题 How can I check whether with ASP.NET 4 is registered to run in IIS 7.5? There must be some way to determine this for sure, other than running aspnet_regiis -i from within the framework's folder. I don't need to check this programmatically, just via IIS Manager or the commend line. I have an .NET page that is returing a 500 error, which I have determined could be due to ASP.NET 4 not being registered with IIS. However, I want to be certain before I make changes to the server configuration. 回答1

Hide a GridView column by name at runtime in ASP.Net

醉酒当歌 提交于 2019-12-06 17:00:29
问题 Is it possible to show/hide a GridView column at runtime by name? I can do it via the index like the following: gridReviews.Columns[4].Visible = false; However I'd like to do the following: gridReviews.Columns["Name"].Visible = false; What's the best way to do this? 回答1: You can use the following code for it: foreach (DataControlField col in gridReviews.Columns) { if (col.HeaderText == "Name") { col.Visible = false; } } 回答2: You can access the gridview by column name indirectly if you can