asp.net

ViewState and changing control order

This has been a fun week (if you look back at my questions you'll see a common theme). I have a repeater that is bound to a collection. Each repeater item dynamic control that corresponds to the collection item, it also renders out a header over each control that contains a Delete link. When the delete link is clicked, the appropriate ...

What is the ASP.NET process for IIS 7.0?

Looking at what's running and nothing jumps out. Thanks! ...

Response.Redirect with POST instead of Get?

We have the requirement to take a form submission and save some data, then redirect the user to a page offsite, but in redirecting, we need to "submit" a form with POST, not GET. I was hoping there was an easy way to accomplish this, but I'm starting to think there isn't. I think I must now create a simple other page, with just the for...

Best way to make a printer-friendly ASP.NET page?

I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables? Is there one elegant solution that works for the majority of the cases? ...

How to bind a MemoryStream to asp:image control?

Is there a way to bind a MemoryStream to asp:image control? ...

Best way in asp.net to force https for an entire site?

About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response.redirect("https://mysite.com") Is there a better way -- ideally some s...

Best ASP.NET E-Commerce Framework

Please suggest and/or vote for your favorite ASP.NET E-Commerce Solution. I'm looking for a full-featured asp.net E-Commerce solution. The solution needs to be easily extensible as I need to extend it to integrate with a custom Flash based personalization engine. It should also have a great administrative back-end that handles inventor...

What is .MSPX?

I've noticed a lot of microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies? ...

UserControl rendering: write link to current page?

I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"): "Default.aspx?page=1" "Default.aspx?page=2" "Default.aspx?someother=true&...

Best practices re: LINQ To SQL for data access

Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this: User -> MessageDetail <- Message <- MessageCategory MessageDetail is a join table that also conta...

Handling HttpRequestValidationException gracefully and ASP.net AJAX compatible?

ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly. Basically, I got an UpdatePanel with a TextBox and a Button, and when the user types in HTML into the Textbox, a Ja...

Combining and Caching multiple JavaScript files in ASP.net

Either I had a bad dream recently or I am just too stupid to google, but I remember that someone somewhere wrote that ASP.net has a Function which allows "merging" multiple JavaScript files automatically and only delivering one file to the client, thus reducing the number of HTTP Requests. Server Side, you still kept all the individual ...

Good Book on Scaling Asp.Net applications

Can somebody suggest a good solid book on scaling Asp.Net applications? One that could potentially scale to millions of users. Some of the books listed here are pretty good (http://highscalability.com/book-store). They cover a range of techniques which can be used independently of the technology used. What I was looking for is somethin...

Moving ViewState out of the page?

We are trying to lighten our page load as much as possible. Since ViewState can sometimes swell up to 100k of the page, I'd love to completely eliminate it. I'd love to hear some techniques other people have used to move ViewState to a custom provider. That said, a few caveats: We serve on average 2 Million unique visitors per hour. ...

Pros & cons between LINQ and traditional collection based approaches

Being relatively new to the .net game, I was wondering, has anyone had any experience of the pros / cons between the use of LINQ and what could be considered more traditional methods working with lists / collections? For a specific example of a project I'm working on : a list of unique id / name pairs are being retrieved from a remote...

.NET MVC Ambiguous Type Reference

Not entirely sure what's going on here; any help would be appreciated. I'm trying to create a new .NET MVC web app. I was pretty sure I had it set up correctly, but I'm getting the following error: The type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly 'C:\MyProject\bin\System.Web.Mvc.DLL' or from assembly 'C:\M...

[ASP.NET] How to access controls in listview's layouttemplate?

How do I set a property of a user control in ListView's LayoutTemplate from the code-behind? <asp:ListView ...> <LayoutTemplate> <myprefix:MyControl id="myControl" ... /> </LayoutTemplate> ... </asp:ListView> I want to do this: myControl.SomeProperty = somevalue; Please notice that my control is not in ItemTemplate, it is in Layout...

Are there any tools out there to compare the structure of 2 web pages?

I receive HTML pages from our creative team, and then use those to build aspx pages. One challenge I frequently face is getting the HTML I spit out to match theirs exactly. I almost always end up screwing up the nesting of <div>s between my page and the master pages. Does anyone know of a tool that will help in this situation -- someth...

Html.RenderPartial call from masterpage

Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am I right?). How do I...

How to Identify Postback event in Page_Load

We have some legacy code that needs to identify in the Page_Load which event caused the postback. At the moment this is implemented by checking the Request data like this... if (Request.Form["__EVENTTARGET"] != null && (Request.Form["__EVENTTARGET"].IndexOf("BaseGrid") > -1 // BaseGrid event ( e.g. sort)        || Request.Form["btnSave"...