asp.net-4.0

How to disable HTML tag validation on a specific TextBox?

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 enti...

Does upgrading a WCF service from .NET 3.5 to 4.0 change the contract?

If I upgrade a WCF Web Service from .NET 3.5 to 4.0, making no other changes, is there any risk of a change to the contract exposed to the outside world? ie. Will my consumers need to reconsume the WSDL? If so, is there anything I can do to stop that happening? EDIT: An example of the kind of thing I'm talking about. We have been usi...

Dependency Injection (Constructor) with WebForms?

Is this possible with ASP.NET 4.0? In 3.5 it was not. If it still is not possible has anyone tried injection with a framework like LinFu? Update I'm specifically asking about constructor inject in ASP.Net webfroms. In 3.5 it was not possible. ...

asp.net 4 workflow examples

I'm trying to locate examples on how to implement .net 4 workflow into an asp.net site. So far all of the examples I've come across have referenced workflow as it existed in .net 3.5.. Which is different. I'd like to avoid having a WCF service container and instead just have the workflows loaded directly by the sites in question. So, ...

Thoughts on running Windows Service type apps on ASP .NET 4 with StartMode="AlwaysRunning".

Hi, Usually I would look at writing a Windows Service to manage tasks that aren't suited to being hosted in a web application. These types of tasks are usually long running processes or scheduled tasks. Although this is normally the primary approach for these types of tasks, people have looked at ways of running these kinds of backgroun...

generate a XML-File and display it in XML-format

Hi, Looked at a tutorial but couldn't get this working: default.aspx: <%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="rssPubba.Default" %> default.aspx.cs protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "text/xml"; Respons...

Left Outer Join LINQ To Entities

I have the following entities: Clients -- ClientID -- ClientName Contractor -- ContractorID -- ContractorName PreferredContractors -- PreferredContractorID -- ClientID -- ContractorID So I have a list of clients and contractors. The clients prefer to work with certain contractors than the others. I want to build a LINQ to Ent...

Are there any tools for generating a WADL file?

I've built a RESTful web service (I'm using asp.net 4, MVC 2) and I want to expose a WADL. Are there any tools built in or otherwise that I can use to build it? I'm not looking (yet) to generate classes to consume it I'm looking strictly for something that can generate the WADL file itself. Thanks. ...

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

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 a "ould 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.", but it only happens th...

Problem with a Simple LINQ To Entities Query

I have a very simple LINQ To Entities query as follows: var orderID = 1; var orders = (from o in db.Orders where o.OrderID == orderID select o).SingleOrDefault(); Can anyone tell me why this query wouldn't work? It doesn't even not throw an exception. I have also checked the SQL profiler and the ...

Forms authentication infinite loop

I have an application that works great on localhost with forms authentication. I deployed it to the deployment machine and it to the build machine and received and endless set of 302 redirects. I try logging onto the deployment machine and access the page via the deployment machines ip and it works again. So it is not working when I t...

How to detect .NET 4 from ASP.NET?

I have a web server that is run by a third party. I don't have direct access to the server but I can deploy ASP.NET code to it. I want to detect if that server is running ASP.NET 4 / .NET 4 or not. What is the easiest way to do that? Is there an environmental property somewhere that would tell me? Or should I try to load a particula...

Jquery Ajax and asp.net 4.0 can't call WebMethod

Well i started by creating a new asp.net webapplication in VS2010 It created a solution that included jquery 1.4.1 After that i created an file named ajax.aspx and added the following in the code behind file: <WebMethod()> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Shared Function GetDate() As String Return Date...

ASP.NET MVC - Uploading an image to Amazon S3

Hi. I have my image from Request.Files[0]. Now, how do I upload this image to S3? I see that in the AWS .NET API you have to specify ContentBody when putting an object which is a string. How would I get the content body of my file? ...

Simple Feedback Upon Data Edit on Webform

I'm using a GridView control, using the Northwind database as a sandbox. I have allowed editing of rows using AutoGenerateEditButton="true" and that all works fine. The book I'm using for reference suggests the following code behind for error handling (C#): protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) ...

ASP.NET 2.0 to 4.0

I have a site in ASP.NET 2.0. I plan to move to 4.0. Is there any thing in particular I need to take care of or I just select the 4.0 framework and recompile and VS 2010 will update the web.config to reflect the changes? ...

ASP.NET 4.0 - How can I make my customized panel control more lightweight?

I've created a custom control that inherits from panel for the purpose of wrapping a drop-shadow around HTML entities. The creation of the control itself was simple enough, but I'd like to utilize this control up to 100 times on the same page. I'm concerned about the additional viewstate size or other bits of additional overhead that ma...

asp.net 4.0 - When I create a custom control that inherits from HtmlContainerControl, I can't get it to show up in the VS Toolbox

I've tried two methods to include my custom control in the toolbox. First, I tried to drag the DLL onto my toolbox, but only some of my controls appeared. Again, when I did it the "choose items" way, only some of my controls appeared. Any of my custom controls that inherit from Web.UI.HtmlControls.HtmlContainerControl don't show up. ...

IE Postbacks Fail After a Few Seconds When Connecting to ASP.Net 4.0 in Localhost.

I noticed an odd problem when developing a web site project on localhost using ASP.Net 4.0, IIS 7.0, and IE8. Postbacks do not work after the page has been idle for a few seconds, like 30 seconds or less. If I load the page, enter some data, and click the submit button immediately, the postback works perfectly, but if I let the page si...

IIS 7.5 Web application inheriting from parent web.config

Well the title says it all im using a asp.net 4.0 project. My file structure looks like this RootSite  -Web.Config  -WebService (WebApplication)   -Web.Config Now the WebService seems to get some parts of the web.config from the RootSite, the problem here is <configuration><system.webServer> So i tryed to place this around that sect...