This trick might work if you have an application that has been moved from the 2.0 framework to 3.5. This happened to me recently and I had tried removing the Web.Extensions reference and adding it back in, deleting old pages that had the older ScriptManager on them and manually removing then adding back the Web.Extensions sections in the web.config file. Nothing worked so I compared the web.config files from the problem project to one that was created from scratch targeting the 3.5 framework. I saw...
Here is a really quick CSS item to apply styles to different types of textboxes in an ASP.Net application. A plain old vanilla asp:textbox control will show as an Input if you view the source of the page. To set the styles of all those controls from a css file you can add this to your css: input[type=”text”] { font-size: 8pt; font-family: Arial; } Then you do not need to add the CssClass property to the textboxes in the aspx file. The input section of the css will be applied automatically. This saves...
Sometimes while developing websites on your dev machine you may want to encrypt sections of your web.config to hide user ids, passwords or other secret type stuff. To do this by using a particular directory path, as in a file system hosted website, you can use the ASPNET_REGIIS utility with the –pef switch. If you are using IIS to host your site rather than a website, you can use the ASPNET_REGIIS utility with the –pe switch and a –app switch to point to the virtual directory. Either of these two...
If you heard about Microsoft Oxite CMS, this is the new one, created as a different project to avoid previous developer comments.: From Press: Microsoft's open-source CMS platform is (re)born | All about Microsoft | ZDNet.com http://blogs.zdnet.com/microsoft/?p=4506 Project Homepage: http://orchard.codeplex.com Quote From Press: The guesses (by me and others) look like they were on target. The “Orchard Project,” which is getting its debut on November 11 at Tech Ed Europe is, indeed, the successor...
Often we have typed datasets coming back from component methods that we want to bind to a GridView at runtime. There are multiple ways to do this. The first technique is without using an ObjectDataSource, the second one is with an ObjectDataSource. Although with either technique its not to difficult to do the bind, formatting the gridview can be a challenge. I have a small app for a library that keeps track of a library’s membership, books checked out, etc. I have a business component that has a...
What is something that is longer than a magazine article and shorter than a book chapter? Give up? It's a Wrox-Blox that Wiley has available online with some going for less than $10.00. Written by the best programmers in the their fields, Wrox Blox are short informational pieces and code that will help get you up-to-speed and keep you up-to-date. Build the knowledge you need quickly on a wide variety of topics. In the DotNetNuke world, there are several of these available for you to review and stay...
Few minutes ago a colleague and friend asked me about some problem he was having with ASP.NET themes. He was using a theme and including a CSS file in it, the CSS file was linked in the generated HTML but clearly it was not applied. Putting the URL of the CSS file in the browser address bar would return an empty result in Firefox, and a crappy DOCTYPE,HTML,HEAD,BODY tags in IE. The same website works normally with other developers running Windows XP or Windows 7. Going further to the problem, I tried...
I had posted this last month and saw a comment posted quickly that you can use CSS as well. A way to use CSS is listed below. <table style="float: left; width: 300px; margin-left: 15px"> </table> <table style="float: right; width: 500px; margin-right: 15px" > </table> Technorati Tags: HTML,ASP.Net...
ASP.Net does not provide a rich text box control in its set of web controls. So, if you need to place a rich text box on your SharePoint page you'll have to use a commercial, free or open source text box control (and there are plenty out there). However if you don't want to introduce another dependency, in the form of an external control, you can use SharePoint's built-in rich text box. If you're creating a page layout that binds to a content types field then its straight forward and you can use...
We found that in some cases you need to consider using Uri.EscapeDataString. In our case we are encrypting the querystring and found that UrlDecode is converting a plus (+) to space. This was causing us errors during decryption. Using Uri’s Escape and UnescapeDataString makes sense for us when constructing a custom querystring in the URL. Here are some details from another blogger… http://blog.nerdbank.net/2009/05/uriescapedatapath-and.html Technorati Tags: .NET,ASP.NET...
Here is a long time issue and this is by no way the first post about it (or probably even the 1000th). In the code below I have two tables that needed to be side by side. The first one on the left allows a user to search for site notes. Just a few dates and a note type. The second table allows a user to enter a new note. Even less to enter just a date and the text for the note. Since I needed the tables side by side I nested both into one big table, keeping each table in it’s own cell and both cells...
Even though this sounds like a really simple thing, what if you do not know the name of the controls, and you do not want to have to add a bit of code that you, or another may developer may forget to every piece of code with a timer in it. The problem I have is that if you have a DropDownList on the same page as a update panel that updates based on a timer, you get a little interference. If the user has the DropDownList open when the update occurs then the DropDownList closes. Very annoying. The...
Yet another internal .NET Team email in my current company, Injazat Data Systems, that I sent yesterday, and am sharing with you as well. jQuery: · Simplify calling ASP.NET AJAX services from jQuery · Use jQuery and ASP.NET AJAX to build a client side Repeater · Reordering invoice lines using jqGrid and TableDND extension · LA.NET jQuery Posts/Articles Agile · Implementing Scrum ASP.NET · Web Development With ASP.NET Learning Material (Course - Source: MSDN Ramp up Learning Program) · ASP.NET Articles...
Allow me to quote here some emails I sent to the the Dot NET developers group in my company, Injazat, or, as we call ourselves, Ninjazat. I thought it’ll be useful to share some with you as well. · ASP.NET MVC - 20 Hours of FREE Video Tutorials · LINQ FAQ o LINQ FAQ for Newbie’s o LINQ FAQ Part 2 · How we handle application configuration · ScottGu ASPNETMVC Session Video Available Now (Part 1/2 & 2/2) · Web Validation: Best Practices and Tutorials · Building a Single Sign On Provider Using ASPNET...
Following my FUNdaments presentation tonight to the East Bay .NET user group on the options available to ASP.NET developers for using AJAX type methods for grabbing information/content from a server from the client side browser, the code can be found here and the presentation can be found here. Once again Beth Massi rocked on the main presentation about VB10, C# 4.0 and Visual Studio 2010. Lots of goodies to look forward to. That said it cracks me up that MSFT is adding more capabilities to facilitate...
Technorati Tags: MVC,ASP.NET,Extension Methods,Html Helper A lot of hype around MVC these days. So, of course, yours truly is working on some project utilizing MVC. While brushing the dust off my raw HTML tag memory and designing the obvious: lists, grids, repeated item displays and the such, I thought "why not use the asp.net controls instead?" For one, most of the ASP.NET data bound controls have a rich site of event post backs to hook up. MVC says: no dice! You can't rely on the event dispatch...
A few weeks ago, I blogged about building an alternative to Dynamic Data. I have to say, it’s pretty sweet. I added a new entity type yesterday, including a couple of minor overrides and I was done. Here are the steps I had to take (testing left out for clarity): Create the entity: 1: public class ExcludedCounterparty : IAuditedWithId 2: { 3: public virtual int Id { get; set; } 4: public virtual Counterparty Counterparty {get; set;} 5: public virtual string CreatedByUser { get; set; } 6: public virtual...
I was going to put this on twitter but it’s a bit longer to tweet. Last week I shared some videos on Google Reader and twitter from Microsoft’s MSDN Chopsticks video website. If you don’t know it, it’s a VERY nice videos website with much content on very interesting topics and very recent products as well as different experience levels of content. http://www.microsoft.com/belux/msdn/nl/chopsticks/ Today, some other friends on twitter noticed the Chopsticks site and were wondering why it doesn’t allow...
This is one way to have up/down or open/close arrows appear on an AJAX AccordionPane. First add a div and an img to the Header of the AccordionPane along with the title (the example uses ‘Add Widget’). <cc1:AccordionPane ID="apTest" runat="server" > <Header> <div id="div1" onclick="UpDownIcons('imgAcc')"> Add Widget <img src="Images/arrow_down.ico" id="imgAcc" alt="expand" /> </div> </Header> Note the onclick function for the div, that...
This post was going to be a rant about how using the ObjectDataSource was impossible to handle exceptions thrown while retrieving or updating data. After some experiments and reading some misleading posts I saw only three possible ways: Use a generic error handler like the Page Error event or the Application Error event in global.asax. Implement handlers for the Updating, Selecting and Deleting events of the GridView bound to the datasource, set the event.Cancel to true and then manually call the...
Thanks everybody who Participated in the event Microsoft Day @ Dhaka, held on 20 June 2009 at IDB Auditorium, Dhaka. It was an excellent gathering of 250+ professionals, specially developers in Bangladesh. Besides the knowledge sharing stuffs, the event was very successful to create a social gathering of technical professionals. I was really found it pretty nice that, I have meet at least 20+ guys there, whom I knew and meet virtually before. The good news for the community is, we will be organizing...
I was trying to implement a simple autocomplete behavior on a textbox using JQuery and the JQuery Autocomplete plugin but it wasn’t as simple as I expected. The basic idea was to get the options from a WCF web service as the user typed. The first obstacle was preparing the Service to accept the calls from the plugin. The plugin accepts a url as the data source and invokes it with two parameters (and a timestamp), q is the query and limit the maximum number of results to return, so I created the following...
A couple of weeks ago I was searching for an alternative to Dynamic Data. My motivation was simple. Integrating Dynamic Data with Oracle and/or NHibernate would be challenging. I was amazed at how little I could find that would solve this problem. Surely Dynamic Data wasn’t the first or only. Eventually, I gave up and worked with a coworker to develop our own alternative. Fresh off a Fluent Nhibernate implementation, we decided to take the convention-over-configuration approach. The Fluent interface...
This is a similar technique to the one outlined in this post. The idea is simple, you have a data value that you want to pass to a Javascript function through a button click on a GridView row. The example below shows how to pass a variable, in this case OtherID, to a Javascript function that opens a new modal window which holds a different aspx page. function ShowOther(OtherID) { window.showModalDialog('OtherPage.aspx?OtherID=' + OtherID, 'dialogHeight:600px;dialogWidth:600px;') } In the GridView...
Typemock guys, the guys behind the only mocking framework that can apply mocking in complex environments like Microsoft SharePoint, are releasing a new Product,, ASP.NET Bundle. Here is what they’re saying about it: Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers. The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and...
This issue started for me after I added an Update Panel to the aspx page. If the calendar extender is showing up weird, like with no background and is displayed no where near where it should be this could fix your problem. Take the original css from the control toolkit (AjaxControlToolkit\AjaxControlToolkit\Calendar\Calendar.css) and copy it into your css file in the application. No css modification is needed and you do not need to set the CssClass property to the control on the aspx page. Technorati...
Here is one way to have data load only when a TabPanel is clicked. In my example I have an aspx page with a TabContainer, two TabPanels both with their own ObjectDataSources that fill GridViews. The first tab’s ObjectDataSource and GridView will run on the page load and that is fine since it would be the first thing a user sees. The overall idea is to have the ObjectDataSource for the second tab to not run on the page load and then have the GridView on the second tab databind only when the tab is...
This post goes along with this previous post on calendar extender display issues. However the formatting fix I used was much less involved than before. Again I had a GridView with some text boxes for dates that I added the CalendarExtender to. And just like before the GridView had some CSS specific to it’s td which involved padding and text alignment. I added all the CalendarExtender styles to my css file and the extender worked fine but did not look quite right. The current date listing was quite...
A friend recently asked how do you make a call to a web page via code. For example, the web page might be designed to return some data in a text-based format and filtered by query string parameters. (While this is more commonly done using a web service, it can also be accomplished by controlling the output of the HttpResponse object.) The following is a basic demonstration of how you might go about coding this in Visual C#: 1: /// <summary> 2: /// Makes a request to a Uniform Resource Identifier...
Using Dependency Injection in a website can get a little dodgy, but in my ASP.NET site use the same base code as my WPF app, I needed a little dependency injection to resolve references at runtime when the application type is known. Now in your ASP.NET page just like in your WPF application you need a little extra bit to get it all going. Finding this for WPF is easy, not so much in ASP. Imports System.Web Imports System.Web.UI Imports Microsoft.Practices.Unity ''' <summary> ''' C# version...
I was integrating a JQuery plugin for file uploads, uploadify, in my app when I saw a very strange behavior. The plugin reported an error transmitting the file to the server and debugging the controller code I noticed the target action wasn’t being called at all. Debugging the client code I found out that the server was redirecting the upload to the login page. The Controller was marked with the AuthorizeAttribute but the user was already authenticated. After a google search I found this article...
Before we can start this journey together, I should take a moment to declare the foundation upon which everything will be built upon going forward. In other words, I need to tell you which languages and frameworks I currently make my living off of and will be blogging about. And I would like to do so without trying to intentionally fan the flames of the already overblown Microsoft vs. [fill-in-the-blank] wars. While I was in college, I thought I could do it all and be an expert in everything. After...
NOTA (2009-06-26): Existe una librería oficial de NHibernate Validator con validadores adicionales específicos para ciertos paises, NHibernate.Validator.Specific.dll (descargar) y ya cuenta con un validador de CUIT. Gracias Fabio Maulo por el dato. La aplicación en la que estoy trabajando está basada en ASP.net MVC y utilizamos Sharp Architecture como base. Sharp Architecture utiliza a su vez NHibernate Validator para la validación de las entidades de negocio por lo que, continuando con el tema del...
Etiquetas de Technorati: ASP.net,JQuery,JQuery Validator,Javascript,CUIT Hace tiempo que quiero armar un blog técnico para compartir experiencias y cosas de interes para desarrolladores web y finalmente me decidí. Para el primer post quiero empezar con algo útil que tuve que armar para una aplicación que estamos desarrollando. Se trata de rutinas de validación de CUIT/CUIL (Código Unico de Identificación Tributaria / Laboral de Argentina). Hay varios ejemplos en la web en distintos lenguajes pero...
About a year ago, I started to evaluate ASP.Net MVC, but decided to put it aside because it was still in heavy-duty development. With the official release a couple of weeks ago, I decided to check it out once again. MVC has a lot of things to offer, but there are a few critical things that we couldn’t overlook. We have a few web applications that all have quite a lot invested in server controls (both third-party and developed in-house). In ASP.Net WebForms, for something as simple as a GridView with...
I ran into an issue using the DetailsView with and ObjectDataSource and paging. In this setup the DetailsView would populate data based off the user’s selection from a dropdown. The paging itself was not the issue that worked just fine. The issue I had was that if the DetailsView displayed data with multiple pages and the user selected a page other than the first and then picked a different value from the dropdown that only had one page to display in the DetailsView it would default to the EmptyDataTemplate....
Visual Studio had a problem where it would added "a lot of nbsp" when toggling from Design to HTML mode with certain custom controls. I blogged about it originally here. It appeared to be fixed as I described on another post, but it only seemed to occur less often. Finally, there is an official fix. It's not truly a "hotfix" though. It asked me to reboot to complete the update. Tags: Visual Studio, ASP.Net, Server Controls...
Kobe is a “getting started” resource kit on planning, architecting, and implementing Web 2.0 applications and services using the Microsoft Platform. I am sure all of you who are interested in this area would be really benefitted with it. Check this out: http://msdn.microsoft.com/en-us/architecture/bb194897.aspx Technorati Tags: architecture,starter kit,asp.net,visual studio...
I was recently working on a GridView and needed to add a calendar for two of the columns while in edit mode. I added the AJAX CalendarExtender and it returned the selected date with no issues. <EditItemTemplate > <asp:TextBox ID="txtDate1" runat="server" Text='<%# BIND("Date1", "{0: MM/dd/yyyy}") %>'></asp:TextBox> <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate1" PopupPosition="Right" CssClass="caltheme" > </cc1:CalendarExtender>...
Probably everyone has at one time or another had a form that needed some sort of date to be entered. If you are like me and use ASP.Net and want to use the ASP calendar control the asp validators don’t work. Well without some work arounds to the calendar control. However if you just needed to validate if the user clicked on a date in the calendar control you can just use the regular calendar control and a customvalidator like this. The calendar control: <asp:Calendar ID="caltest" runat="server"...
The journey started seven months ago when I was asked by Wrox if I was interested or if I knew someone that was interested in writing the new DotNetNuke5 book. At that time, I put together an all Florida team with the exception of DotNetNuke founder Shaun Walker. The team consisted of Darrell Hardy, Stan Schultes, and Ryan Morgan. Everyone was committed to the writing of the book and all are extremely knowledgeable. We all have been speaking together at code camps in the Florida area about DotNetNuke....
The following is a simple checklist you can use when building web applications. Much of this still applies to other technologies and can easily be extended. I try not to get too specific on technology or methodology, but it is definitely leaning toward ASP.NET. If you can think of something I am missing or disagree, please leave a comment. Detailed information follows the checklist. How much of the checklist you follow will depend on the project. If its just a hobby site, you may skip items like...
Have you ever, when developing a website, been frustrated when you get a different result when you deploy your application to http://site/ and http://site/app/. I don’t know about you, but it annoys the hell out of me. All that work in CSS and none of your images work when you run it in a different location. This would be especially frustrating when you are running multiple feature branches and need Kerberos interaction. The amount of work required to get Kerberos to work (SPN’s, URL’s, Delegation...
I inherited an app to make some updates. It was an older 1.1 ASP.Net application that was already upgraded to 2.0. All the new files I wrote worked fine and it built error free. I could debug the app and run it locally with no problems. Once I was ready to publish the app it then finally decided to give me some grief. I would get an error after the build completed and the publish started. The error was: Data at the root level is invalid. Line 1, position1. When I clicked on the error line in VS it...
I've had a few comments to my PageMethods blog from about a month ago. They were all along the lines of "not enough code." I wasn't really intending to provide a detailed account of my experience, but to exclaim how cool PageMethods are (at least for my scenario). Well, I am hoping to put some time aside over the next week or two to write a brief article on the subject. I'll be sure to include all of the code and hope to go through each step of the relatively short process. By the way, if anyone...
[If you are looking for a quick answer, jump here.] Yesterday morning was probably one of my least favorite in recent memory. I arranged to take the day off to go shopping with my wife, but I had to check-in to make sure everything was okay at the office. I checked my email from home and found that there were suddenly two issues reported on my project that was scheduled for an update in production that night. Needless to say I had to address the problems. It turns out that neither were more than...
Today I was working on a WebForm that includes a GridView which presents text boxes for various columns. I put these in the ItemTemplate so all of the rows could be edited at any time. The next requirement was to update certain read only columns (e.g. Total Amount) based on the changes of the others. Originally, I had the entire GridView in an UpdatePanel, but that quickly proved to be a problem for two reasons. First, the updates were fairly slow. Second, the active control would lose focus after...
Though some of you that were on the fence or have not year head about the MSDN Dev Con, are now more interested in coming out. It’s a tiny price compared to PDC and is coming to a city near you! A good group of local celebrities will be presenting along side proven Microsoft experts at the Orlando event. I will be in the attendance and around any community areas. And any social after event :) Bayer White (Jacksonville), Joe Homnick (Boca Raton), Christopher Bennage (Tallahassee), Rob Eisenberg (Tallahassee)...
Thank you all for attending my “Applying Domain Driven Design on Asp.net MVC” session. It’s interesting how things went that we got a bit deep into the ASP.NET MVC framework and have achieved the geeky talk goal via covering the other aspects of ASP.NET. Even that this took the entire session, it is nice that it could benefit the attendance. I am not sure whether we can arrange another session for Domain Driven Design fundamentals and combining that in the same project while using the MVC pattern...
I was recently following along in a quick tutorial in Microsoft ASP.NET Programming with Microsoft Visual Basic .NET Version 2003 Step By Step by G. Andrew Duthie, when low and behold I came across a fundamental tutorial about ASP.NET authentication that just didn't work. The culprit? authorization forms credentials has a default of SHA1, not Clear that the book assumed. I checked through the MSDN entries to make sure this still applied in 3.5, even though the book was written for ASP.NET 1.1 (which...