Tag: ASP.NET
All the articles with the tag "ASP.NET".
-
ASP.NET DataPager not paging after first PostBack?
A few posts ago, I mentioned that I am currently giving a classroom training on ASP.NET. People attending are currently working on a project I gave them, and today one of them came up to me with a strange problem... Here's the situation: in VS 2008, a web page was created containing 2 controls: a DataList and a DataPager. This DataPager serves as the paging control for the DataList. Databinding is done in the codebehind: [code:c#] protected void Page_Load(object sender, EventArgs e) { ListView1.DataSource = NorthwindDataSource; ListView1.DataBind(); } [/code]
-
ASP.NET MVC Framework - Basic sample application
You might have noticed that I'm quite enhousiast about the new ASP.NET MVC framework. Basically, this new ASP.NET MVC framework is an alternative to standard ASP.NET webforms, with some advantages: For more information and a step-by-step tutorial, check Scott Guthrie's blog: For an article I'm working on, I am writing a sample application using this framework. This sample application is a very basic photo album website, listing some albums and photo's. Anyone who's interested in a sample MVC application (no data entry yet!) can download it.
-
ASP.NET 3.5 Extensions CTP preview released
Just over the weekend, Microsoft has released the ASP.NET 3.5 Extensions CTP. This download includes several additions to ASP.NET 3.5: I'll be doing some testing during the week, and keep you all informed.
-
ASP.NET MVC framework preview to be released next week
Half the world has been focussing on the release of the new Visual Studio 2008 and .NET 3.5 last week. That is good, as .NET 3.5 offers lots of nice new features and improvements. In the blogosphere, I haven't read much about an extension I've been waiting for anxiously: the new ASP.NET MVC framework. Luckily, Scott Guthrie posted some examples on it, and I can't wait for a preview to be released next week. I'll keep you informed!
-
ASP.NET load balancing and ASP.NET state server (aspnet_state)
At one of our clients, we used to have only one server for ASP.NET applications (including web services). Since this machine is actually business-critical and load is constantly growing, the need for a second machine is higher than ever. This morning I was asked to set up a simple demo of a load-balanced ASP.NET environment. I already did this in PHP a couple of times, but in ASP.NET, this question was totally new to me. Things should not be very different, I thought. And this thought proved right! A bit later, we had a load balancer in front of 2 web server machines. We got everything configured, fired up our webbrowser and saw a different page on each refresh (stating the server's hostname). Load balancing mission succeeded!
-
Advanced ASP.NET caching events
Currently, I'm giving an ASP.NET classroom training at our company, which actually is quite good for me: I needed to refresh all ASP.NET concepts, as those all fade away slowly when you don't use them for a while... Now, one of those refreshed concepts is ASP.NET's caching. ASP.NET offers a flexible built-in caching mechanism, providing you with a global "Cache" object in which you can get and put data which needs to be cached for a while. One of the cool things about ASP.NET caching is that it actually listens to what you want: if you need the cache to expire after 10 minutes, it does so. Also, when memory is needed for other actions on the webserver, ASP.NET will gently clean the cache depeding on cache item priorities.
-
Enabling HTTP proxy for .NET webservice client
Have you ever written code that makes external (Soap) webservice calls? Tried that same code on your company network? Most of the time, this does not work very well due to a proxy server sitting in between, requiring authentication etc. You can start tweaking your Web.config file to set this proxy the right way, or you can override the generated web service class and include the following code snippet: [code:c#] using System; using System.Net; public class SomethingProxyEnabledService : com.example.service.something { protected override System.Net.WebRequest GetWebRequest(Uri uri) { WebRequest request = base.GetWebRequest(uri); request.Proxy = WebRequest.DefaultWebProxy; request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
-
Remove unnecessary HTTP modules from the ASP.NET pipeline
Trying to speed up some things in a demo ASP.NET application for a customer, I found a really simple and effective way to remove some HTTP modules from the ASP.NET pipeline. When you are not using WindowsAuthentication or PassportAuthentication or ..., you can easily disable those modules. This decreases ASP.NET bootstrapping time as there are fewer object creations to do every page load... Now, how to do this? Very easy! Fire up your Visual Studio, and open Web.config. In the HttpModules section, add some "remove" elements, one for every module you whish to disable. If HttpModules section is not present, you can add it yourself. [code:xml]
-
TFS Team Build and ASP.NET websites
Here's one I'd really like to share with everyone trying to build ASP.NET websites using TFS Build. First of all, a little story about the project setup... A VS2005 solution was created a few weeks ago. This solution included some projects, namely ASP.NET website, Domain Layer class library, Business Layer class library and DAL class library. The ASP.NET website uses project references to the class libraries, enabling automatic updates of all references on build. So far, so good. As a test case, this project was added to a new TFS project, and created a build for. That specific build kept failing forever, ignoring all tips I found on various websites.
-
Enable sitemap security trimming in ASP.NET 2.0
Want to enable security trimming for your ASP.NET sitemap? Here's how... First of all, you need a new section in your web.config system.web element: [code:xml] <system.web> <!-- ... other system.web configuration stuff ... --> <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> <providers> <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> </system.web> [/code] Next, you should specify which pages are visible to who: [code:xml]