background preloader

ASP.Net

Facebook Twitter

Configuring ASP.NET 2.0 Application Services to use SQL Server 2000 or SQL Server 2005. One question I’ve seen asked a few times by people over the last few weeks is “how do I setup the new ASP.NET Membership, Role Management, and Personalization services to use a regular SQL Server instead of SQL Express?” This blog entry walks you though a few simple steps on how to-do this. Quick Review: What are the new ASP.NET 2.0 Application Services? ASP.NET 2.0 includes a number of built-in “building block” application services. We call them “building blocks” because they are useful core frameworks for enabling super-common scenarios with web applications today – and as a result can provide significant productivity wins and time-savings for developers. The ASP.NET Application Service APIs are designed to be pluggable and implementation agnostic, which means that the APIs do not hardcode the details of where data is stored with them.

Default SQL Express Providers Out of the box, most of the ASP.NET 2.0 application services are configured to use the built-in SQL Express provider. Scott. Configuring HTTP and HTTPS. WCF services and clients can communicate over HTTP and HTTPS. The HTTP/HTTPS settings are configured by using Internet Information Services (IIS) or through the use of a command-line tool. When a WCF service is hosted under IIS HTTP or HTTPS settings can be configured within IIS (using the inetmgr.exe tool). If a WCF service is self-hosted, HTTP or HTTPS settings are configured by using a command-line tool.

At the minimum you will want to configure a URL registration, and add a Firewall exception for the URL your service will be using. The tool used to configure HTTP settings depends on the operating system the computer is running. When running Windows Server 2003 or Windows XP, use the HttpCfg.exe tool. Windows Server 2003 automatically installs this tool. When running Windows Vistaor Windows 7, you configure these settings with the Netsh.exe tool. Namespace reservation assigns the rights for a portion of the HTTP URL namespace to a particular group of users. Tasks Reference. Reading / Writing data from Excel in C# ASP.Net 2.0 - Logiclabz.

Iis - Using makecert for Development SSL. How to configure WCF REST service hosted in IIS (properly)? - Smallfish. Trying to configure WCF REST service hosted in IIS you may encounter an error message saying something like: "The message with To '*' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree. " where '*' is the address you are trying to access. There are some answers here and there on the web but those are incomplete or hard to understand. The Problem When using the "*.svc" file to host a service within ASP.NET web site, regular WCF ServiceHost is created. WCF itself does not understand the REST address (as specified by the UriTemplate property of WebGet attribute), so we should configure the proper endpoint behavior "webHttp". The Solution So, here is how to configure WCF REST service to be hosted in IIS: To host a service on IIS we are creating ".svc" file to map that file URL to the service type, for example: Thats all!

GlyphRun and So Forth « Smellegant Code. In WPF there are a number of ways to get text painted, ranging from Label at the simple end, all the way down to GlyphRun if you want to get your hands dirty. The latter stuff seems very thinly documented. Want to know what the bidiLevel parameter to the constructor of GlyphRun means? According to the documentation, it is "a value of type Int32". Very helpful.

This is a problem because it is your only option if you want to be able to control the positions of individual characters. After fooling around for three hours and (this was the crucial part) stepping through the WPF source code to see how FormattedText does it, I came up with this, which is basically the sample I wish I’d had in the first place. It draws the text "Hello, world! " Typeface typeface = new Typeface(new FontFamily("Arial"), FontStyles.Italic, FontWeights.Normal, FontStretches.Normal); GlyphTypeface glyphTypeface; if (! Among the major points of interest: Like this: Like Loading...

Resizing images from the server using WPF/WIC instead of GDI+ - Tales from the Evil Empire. Caution: Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. Kind of scary, isn’t it? Nobody likes diminished performance and run-time exceptions. But when you need to generate thumbnails from managed code, what other choices do you have? There used to be two: using interop with native APIs (which won’t work in medium trust) or writing your own image manipulation library from scratch. Since WPF was introduced into the .NET framework, there has been a third possibility that will be the topic of this post.

Before we look at that, let’s put things in perspective: there are LOTS of applications and components out there that are using GDI+ (or more accurately its System.Drawing managed code expression) and they work just fine. So let’s go and resize images. How to render a ASP.NET User Control within a Web Service and return the generated HTML « Jim's Blog. My needs: Use ASP.NET AJAX PopUpExtender control to provide a mouseover popup with additional content relevant to the GridView row.

Use DynamicContextKey to pass in GridView record's unique identifier. My wants: Use a User Control to render the HTML response, so I don't need to build the HTML code using a StringBuilder or HtmlTextWriter. First attempt My initial code was something similar to the below code: StringBuilder htmlResponse = new StringBuilder(); using (StringWriter sw = new StringWriter(htmlResponse)) { using (HtmlTextWriter textWriter = new HtmlTextWriter(sw)) { UserControl myControl = new UserControl(); myControl.LoadControl("myUserControl.ascx"); myControl.Attributes["MyDataKey"] = myDataKey; myControl.RenderControl(textWriter); } } return htmlResponse.ToString(); However, my StringBuilder htmlResponse (htmlResponse) and StringWriter (sw) were always empty.

Note, this is within a System.Web.Services.WebService class and not within a System.Web.UI.Page class. Second try. Image Upload using REST protocol. Hi, I've been struggling in writing WCF Rest Service to upload a binary file thru POST method. I tried the below sample code given in this post. But, my web service is throwing error "IRestService has multiple request body parameters, one of which is a Stream. When the Stream is a parameter, there can be no other parameters in the body.] " I searched net and added BodyStyle = WebMessageBodyStyle.WrappedRequest to the webinvoke. still getting the same problem. My requirement is to post a binary file along with 3 other data. Please help me how to proceed. Lalitha. Asynchronous processing in ASP.Net MVC with Ajax progress bar - Sean McAlinden's Blog. I was asked the other day how to process a long running task asynchronously using ASP.Net MVC along with JQuery to update a progress bar on the view via Ajax.

There are many ways of accomplishing this type of multithreading, in this blog I’m going to document one of the simplest and easiest to implement (this solution is really for small apps). Firstly, create a class that will manage the long running task – as this is a contrived example without the use of a database, the class is going to have static dictionary property that will store the unique key and status of each long running task. – the dictionary is used to allow for multiple users firing off individual long running tasks. Now we have the long running class in place we need to create some controller actions to do the following: Start the long running process End the long running process Get the current process status One interesting line you may have notices in the GetCurrentProgress method is the following: Kind Regards, ASP.NET Routing. The topic you requested is included in another documentation set. For convenience, it's displayed below.

Choose Switch to see the topic in its original location. ASP.NET routing enables you to use URLs that do not have to map to specific files in a Web site. Because the URL does not have to map to a file, you can use URLs that are descriptive of the user's action and therefore are more easily understood by users. In an ASP.NET application that does not use routing, an incoming request for a URL typically maps to a physical file that handles the request, such as an .aspx file. In ASP.NET routing, you can define URL patterns that map to request-handler files, but that do not necessarily include the names of those files in the URL. For example, in the request for the routing parser can pass the values Products, show, and beverages to the page handler.

This topic contains the following sections: Typical URL Patterns in MVC Applications.