asp.net

Using ASP.NET MVC, how to best avoid writing both the Add View and Edit View?

The Add view and the Edit view are often incredibly similar that it is unwarranted to write 2 views. As the app evolves you would be making the same changes to both. However, there are usually subtle differences. For instance, a field might be read-only once it's been added, and if that field is a DropDownList you no longer need that Li...

Asp.net MVC User Control ViewData

When a controller renders a view based on a model you can get the properties from the ViewData collection using the indexer (ie. ViewData["Property"]). However, I have a shared user control that I tried to call using the following: return View("Message", new { DisplayMessage = "This is a test" }); and on my Message control I had this...

Can I access ASP.NET Development server in an intranet?

Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page. Now I want to test it in the intranet I have. Can I use this server or I need to configure IIS in this machine? Do I need to configure something for it to work? I've changed the localhost to the correct IP and I opened up ...

Forms Authentication across Applications

I'm working on a internal web based tool for my company. Part of this tool is another application (The Cruise Control Dashboard) that runs in its own Virtual Directory under my root application. I wanted to limit access to this internal application by setting up Forms Authentication on it, and having a login form in the root application...

Calling base Methods When Overriding Page Level Events

In my code behind I wire up my events like so: protected override void OnInit(EventArgs e) { base.OnInit(e); btnUpdateUser.Click += btnUpateUserClick; } I've done it this way because that's what I've seen in examples. Does the base.OnInit() method need to be called? Will it be implicitly be called? Is it better to call it at t...

Alternatives to Windows Workflow Foundation?

I've been using WWF for a while as part of an internal call center application (ASP.NET), and while learning it was a good practice in understanding how a state machine based workflow system should work, I am definitely not in love with WWF itself. In my opinion it is: Overly complex, especially for use within web apps (all that thread...

Calling ASP.NET web service from ASP using SOAPClient

I have an ASP.NET webservice with along the lines of: [WebService(Namespace = "http://internalservice.net/messageprocessing")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class ProvisioningService : WebService { [WebMethod] public XmlDocument ProcessMessage(XmlDocument message) {...

"Data Execution Prevention" kills (VS2008) local ASP.Net Development Server (aka Cassini) on Vista 64

Occasionally i find that while debugging an asp.net application (written in visual studio 2008, running on Vista 64) the local ASP.Net development server (i.e. 'Cassini') stops responding. A message often comes up telling me that "Data Execution Prevention (DEP)" has killed WebDev.WebServer.exe The event logs simply tell me that "WebDe...

Delete Datalist row with multiple primary keys

I have a datalist with a OnDeleteCommand="Delete_Command". I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event. If I use DataKeyField I'm limited to only one key. Any workarounds for this? Thank you ...

Best TinyMce editor Image Manager / File upload for Asp.net Mvc

What is the best Image Manager to integrate in TinyMce editor apart the official Moxiecode commercial ones? I'm looking to integrate a light texteditor in an asp.net mvc application and I choosed the Tinymce solution (and not the classic FCKEditor as this seems more lightweight and more jquery friendly). Sadly TinyMce doesn't come with...

Views in separate assemblies in ASP.NET MVC

I'm trying to create a webapplication where I want to be able to plug-in separate assemblies. I'm using MVC preview 4 combined with Unity for dependency injection, which I use to create the controllers from my plugin assemblies. I'm using WebForms (default aspx) as my view engine. If I want to use a view, I'm stuck on the ones that are ...

Display rows in multiple columns in Asp.net Gridview

By default each row of a Gridview maps to each row in a datatable or dataset attached to its datasource. But what if I want to display these rows in multiple columns. For example if it has 10 rows, 5 rows each should be displayed in 2 columns side by side. Also can I do this with the Infragistics grid. Is this possible? ...

Profiling/Optimizing (Sharepoint 2007) Web Parts

I just wonder what options there are to properly measure/profile/optimize ASP.net 2.0 Web Parts, especially the ones for Sharepoint 2007? As Web Parts are a layer on another layer of technology, getting resource usage, open handles and stuff only for the web part seems to be a bit difficult. Does anyone know some good tools or practice...

Catch Exception when non-existant controller is requested

I want to be able to capture the exception that is thrown when a user requests a non-existant controller and re-direct it to a sweet 404 page. How can I do this? For example, the user requests http://www.nosite.com/paeges/1 (should be/pages/) they get re-directed to the 404 rather than the nasty exception screen of death? ...

How does the ASP.NET "Yellow Screen of Death" display code?

I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message? Feel free to edit this question/title, I know it doesn't really make sense. ...

Process raw HTTP request content

I am doing an e-commerce solution in ASP.NET which uses PayPal's Website Payments Standard service. Together with that I use a service they offer (Payment Data Transfer) that sends you back order information after a user has completed a payment. The final thing I need to do is to parse the POST request from them and persist the info in i...

ILMerge and Web Resources

Hello all, We're attemtping to merge our DLL's into one for deployment, thus ILMerge. Almost everything seems to work great. We have a couple web controls that use ClientScript.RegisterClientScriptResource and these are 404-ing after the merge (These worked before the merge). For example one of our controls would look like namespace...

Refactoring for Testability on an existing system

I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relatively disorganized throughout the solution. It's by no means terrible, but definitely can use some work; you all know what I mean. I've been pe...

Double postback problem

Hi, I have a ASP.NET 1.1 application, and I'm trying to find out why when I change a ComboBox which value is used to fill another one (parent-child relation), two postbacks are produced. I have checked and checked the code, and I can't find the cause. Here are both call stacks which end in a page_load First postback (generated by teh ...

Direct link from Yellow Screen to line in code

I've been looking for a while for this, and having been thinking about creating it myself, but hadn't got the feeling I knew the right point to start. I would like to have a link on the Yellow Screen that would directly jump to the correct line in Visual Studio. Anyone seen this or done this? If it needs another error page, is it possi...