So there are a couple great walkthroughs out there that talk about using jquery jsonp in cross-domain scenarios. They talk a lot about the requesting and server side, but not so much about how to use the callback. So to clarify, I’ll step through what I did to make this work including providing my implementation for a new ActionResult called JsonPResult for MVC.
Read more…
So lately, I’ve been pretty wrapped up with kids and family so I haven’t had much time to post anything new. However, I did start a new project, which I’ll detail out more as I go. It’s been quite the experience so far since I decided to build this one from the ground up using MySql and Linux/Mono. I’ve never designed apps like that before. For one, I’ve had to learn a new set of design tools for MySql as opposed to my comfortable Sql Management Studio. And I’ve also had to very incrementally test different programming technologies and methods that were questionably supported in Linux/Mono. The beauty of this is that no matter what I do to make it work for Mono, the app will always work on Windows, and there’s little development time lost if I have to fall back to its native platform.
Read more…
As the second part of this series, I’ll look at building a website that can use the MySql Membership Provider. This is one of the main hang-ups I’ve run into while porting one of my ASP.NET applications to Mono. With the latest MySql Connector, this turns out to be a very easy thing to do. It’s nearly as simple as setting up your web.config with the correct parameters and getting the right connector version.
Read more…
So the other day, I wanted to build a confirmation dialog using jQuery with an existing Asp.Net web forms Button control. I wanted this dialog to be modal; and upon confirmation, I wanted it to postback using the Button’s server-side click event. After toying with the jQuery dialog, I realized that its dialog doesn’t suspend the process while waiting for user input. So it also causes problems with confirmation since clicking the original button will always postback. So with a few tweaks, you can prevent the postback and emulate the click event pretty easily.
Read more…
While playing and learning with MVC, I designed a simple little CMS (content management system). My goals for the project were to keep it simple, use MVC, and make it SEO optimized as possible. Well finally the first version of that application is published on CodePlex. Feel free to go check it out. Don’t forget to peek at the setup documentation.
So you have an Asp.Net application that needs to authenticate its users to Active Directory, and you also want to use their credentials for connecting to a database server. It’s pretty logical thing to do in an enterprise environment where you would normally control all your user privileges using Active Directory. This is especially nice since you also don’t have to put sensitive credentials in your web.config file.
Read more…
Well this was a fun one. For onelittlebow.com, we’re using Google Checkout as one of our checkout methods. Recently we just switched to using a virtual dedicated server rather than the normal shared hosting environment at GoDaddy. Their shared hosting never really supported Google Checkout notifications because their shared IIS servers were configured to use Basic Authentication with Windows and always pre-authenticated the request. Since the merchantID and key wasn’t a valid NT account on the server IIS would always kick back a 401 response and ASP.NET wouldn’t even touch the request.
Now with the virtual dedicated environment, we are finally able to use these callbacks and handle the authentication header ourselves in code (or by setting up an account on the server). But in production, we must use fully trusted SSL. That’s not a huge deal; we just purchased one of their SSL certs and installed in on our server. Easy peasy right? Well if you’re like me and you’re not super familiar with the nitty gritty details of SSL and certificate validation, then you might be getting this error in the Integration Console on Google Checkout’s admin page.
We encountered an error trying to access your server at https://somewhere.com/callback_endpoint — the error we got is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Read more…
While developing in Visual Studio using the ASP.NET Development Server, all your requests are handled by the asp.net handler. So when you’re playing with things like url redirection or custom handlers, it will work fine while you’re developing. But when you deploy it to IIS, you need to add the handler for the extension so IIS knows that ASP.NET is processing the request.
I just ran into this while building an image handler for custom_folder/*.jpg. I wanted all requests for jpg files here to be handled by my custom handler. My IIS Server wasn’t responding properly because it wasn’t configured to pass that request to asp.net. Unfortunately, I’m working with a shared hosting environment and Medium Trust, so I have to change this to something that is handled by asp.net by default like *.ashx, aspx, etc.
In a full trust environment where you have acess to the IIS server, you can add a new ISAPI handler for any extension you want to override in asp.net. Just go to the application configuration for the website or virtual directory and add a new ISAPI filter for your extension. When adding a new extension filter, point it to the same path as the other asp.net ISAPI handlers. If you want it to just handle for a single folder, it might be a good idea to set it up as its own virtual directory with a filter for that virtual directory alone. This will allow asp.net to handle the requests for that file type, then you can use your custom handler as you normally would in the development environment.
If anyone is interested, I can provided more information.