To add a new role into my aspnet database, I tried to use the asp.net Web Application Administration Website. But it was showing the following error message:An error was encountered. Please return to the previous page and try again. Strange, because I was sure, that my connectionstring was correct.After a while, after reading about the asp.net Web Application Administration Website, I found that it can't handle spaces or special character in the project path.My project was located in C:\Users\JEROEN\Documents\V...
Here’s a quick start introduction to the ADO.NET Entity Framework Code First Development Pattern. For a more complete (but still intro) walkthrough, check out ScottGu’s blog. At the time of this writing, you’ll need the EF 4.1 Release Candidate. After EF 4.1 is released you’ll no doubt be able to find it on the ADO.NET team blog. 1. Create a new empty ASP.NET MVC2 Web Application, add a reference to System.Data.Entity. If using the EF4.1 RC - add a reference to the EntityFramework dll that comes...
Up until recently one of my applications has used the membership provider within ASP.NET exclusively. However, it has been proposed that while the currently defined roles are beneficial, security needs to be more granular to restrict both access to certain pages and functionality present within a given page. Unfortunately, the role based security ASP.NET gives you out of the box falls down in this area. This is not due to a lack of foresight by Microsoft, but rather it was simply not designed for...
To set an ASPNET master page dynamically, use the Page_PreInit function and set the Page.MasterPageFile property. For example: protected void Page_PreInit(object sender, EventArgs e) { this.Page.MasterPageFile = "~/MasterPages/" + mymaster + ".Master"; } In the above example, mymaster should be set by whatever your requirements dictate – read from DB/CMS/whatever. The page (aspx) itself shouldn’t have any other reference to the master page (ie, no “MasterPageFile attribute in the page directive),...
Here’s a TruncateAtWhitespace function that takes an incoming parameter value and an incoming max length, and returns a substring broken at a whitespace position. This way if you have “Lance has a blog” and you need to truncate it to 8 characters or less, you get “Lance” instead of “Lance ha”. /// <summary> /// Truncate at the end of a word /// </summary> /// <param name="value">The original string</param> /// <param name="maxlength">The maximum length of string to return</param>...
I needed to dynamically configure log4net – outside of the web.config file. Here is my solution: 1. All that configuration of log4net in web.config? Forget it. 2. Create a separate log4net.config file (name it whatever you want), with the usual configuration content in it defining whatever appenders you want. For example if you want a rolling file log: <log4net> <appender name="RollingLogFileAppender" type="log4net.Appender.Roll... <param name="File" value="C:\\Temp\\mylog.txt"...
Alex (http://simpleisbest.co.uk/) does a very good job in covering the new features of .NET 4.0 and Visual Studio 2010. His focus is on the developers that have experience in development using previous versions of Visual Studio, more specifically Visual Studio 2008. The following are my views towards his book. 1. Scope / Coverage Even as the book is labeled as introduction, it is covers a broad spectrum of technologies, features and references that are focused into helping a developer quickly decide...
Few months ago I've been seeing many users in the forum asking how to generate dynamic textbox on the form and save the values to the database on Button click, so I've decided to write this post and wrap up all the examples that I wrote before on how to accomplish the task using different controls so that when I encounter such or similar questions again in the forum, I can simply refer them to this post. Here are those examples: Using ASP Table: FAQ: Dynamically Adding Rows in ASP Table on Button...
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...
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...
After a year of answering questions at the WebParts and Personalization forum section, I consider the following items below as “frequently asked questions”. I decided to write this so that I can point them to this post whenever I find a question that can be found here. The following are the list of items that I consider as FAQ: 1. How to Get Started with ASP.NET WebParts? ASP.NET Web Parts Overview ASP.NET WebPart Controls Implementing ASP.NET WebParts with Different Authentication modes Video: Utilizing...
Introduction to Radial and Linear Gauge Radial Gauge Linear Gauge Deployment Let’s start by creating an AJAX Enabled Website, and dropping an “UltraGauge” control into the Web Page, initially you would see a blank Gauge, this gives the opportunity to select the type of gauge we need for the web page, for your convenience there are tones of Gauges available in the presets, there are Radial Gauges, Linear Gauges, Digital Gauges and other combination Gauges like Radial and Digital together, or Linear...
I decided to post this because I wan't to share this information that I have gathered during my investation about ASPNET WebParts last 2007. Maybe this will be useful for those who are using ASPNET WebParts in ASPNET 2.0. Basically this information shows the difference between the Standard WebParts that shipped in ASP.NET 2.0, ASPNET Futures and My Custom WebPart with Custom Verbs. Main OBJECTIVES: * Allows cross browser drag and drop capability (can be moved between WebZones) * Ajax enabled Findings...
For those who wan't to use the Micorsoft.Web.Preview dll then you need to download the Microsoft ASPNET Futures (July 2007 release) first that contains that dll.. You can download it HERE. Technorati Tags: General...
I needed a quick way to cache some data for a feature I’m currently working on. The scenario is that the user should be able to type ahead and be presented with a list of matching options (AJAX auto complete). This data is coming from an external web service and is exposed via the core API of the application which in turn is exposed over WCF. So for AJAX to be able to get to this data it must talk to the WCF service, but this is not directly possible since cross site scripting is not allowed in the...
The other day I ran across a blog post by John Robbins discussing Code Complete, by Steve McConnell. It seems that John, like myself, is quite a fan of the book. He suggests everyone in his debugging class read the book, and even suggested, somewhat tongue in cheek I suspect, that they write up a book report. Someone actually did it. An excellent writer in his own right, the book report author reminded me that it was indeed time, again, to re-read Code Complete. Just as Relevant Today Code Complete...
In default configurations web applications and web services are running under the credentials of a predefined user account. For ASP.NET webapplications this is the ASPNET (or similar) account and for WCF services this is the user that started the servicehost or the user associated as logon account for the windows service hosting the services. This means access to resources is restricted by this account. This is most often a dedicated account and not related to a real user. In a good secure environment...
I just got back from a business trip and sitting there on the counter was a copy of my latest book from Wrox! This book (my 20th) is titled Professional ASP.NET 3.5 AJAX. This was a fun book and I wrote this with some great co-authors including Matt Gibbs, Dan Wahlin, and Dave Reed. Amazon says that the book will be available on February 3rd (not too far away). Here is some of the introduction I wrote for the book: ----------------------------- ASP.NET revolutionized Web application development....
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...
The out-of-the-box StaticSiteMapProvider is great for, well, static web sites. I don't find the StaticSiteMapProvider (and web.sitemap) model very practical for the dynamic nature of web sites/applications and especially Asp.Net Mvc applications. In an mvc application it's difficult to render a static sitemap that allows breadcrumbs like: Home Home > Cars Home > Cars > Porsche 911 Home > Cars > Porsche 911 > Edit For the sake of discussion, and to keep the discussion as small as...
WebParts Cross- browser drag and drop is a very common issues on ASPNET WebPart Framework.. Basically WebParts doesn't support the Drag and Drop feature in Firefox browsers and this known to be a BUG for ASPNET Webpart Framework.. To get things working in all browsers including the cross browser drag-and-drop feature then you would need to use Visual studio 2008 / VWD 2008 with latest version of the Microsoft ASPNET Futures (AJAX Control Toolkit 3.5).. For more detail information then i would suggest...
I decided to write this sample demo because I always encounter this kind of problem in the ASPNET Forum . So here's a sample (one way) solution on how to populate the second DropDownList based on the value selected on the first DropDownList using the ADO.NET way. Assuming that DropDownList1 contains the list of countries and we need to populate the list of States in a particular country based on the first DropDownList selection. protected void PopulateDropDownList1(){ string queryString = "SELECT...
I decided to write this article because I always encounter this kind of problem in the ASPNET Forum frequently. So here's a simple (one way) solution on how to invoke the Button Click event when pressing the ENTER key in the TextBox control. ASPX Mark Up and JavaScript function <head> <title>Untitled Page</title> </style> <script type="text/javascript" language="javascript"> function controlEnter (obj, event) { var keyCode = event.keyCode ? event.keyCode : event.which...
I’ve have just sent this email to the developers exchange group in my company: I think you all know the routing engine that works with ASP.NET MVC framework to enable customizing URLs and mapping those to the corresponding controls, actions and their parameters. Some of you may know too that the routing engine is not just for ASP.NET MVC, but ASP.NET in general. If you happened to download the source code of the ASP.NET MVC framework (any preview), you’d have noticed that the routing comes as DLL...
This is problematic with ASP.NET AJAX. The main Script Components are NOT sent to the client when in :Legacy” mode. This is “By design” in ASP.NET AJAX, although it is a clear limitation!! I’m investigating the problem for other solutions and will be sending an update soon. Thank you, Iman Halawany, for making me note this. I’ve been working on WCF services and ASP.NET MVC stuff lately than normal webforms, so, didn’t realize this obvious showstopper. To all my readers, I owe you a BIG apology. The...
If you have ever thought that the famous if(Page_ClientValidate("val... {/*JS Code*/} and myValidator.ValidationGroup = "validationGroup"; are sure not enough client side capabilities in ASP.NET validators, you are right. The list of client side API for ASP.NET Validators can be found on this MSDN page "ASP.NET Validation in Depth": http://msdn.microsoft.com/e... Look for subtitle: "Client-Side APIs". Thanks Simone Chiaretta for mentioning...
I finally got the nerve and installed Windows 2008 Server on my x64 laptop. It is rocking so far! It was a little confusing at first because there are lots of things turned off by default (it IS a server OS after all). But I found a post on Building a Windows 2008 x64 Laptop and it worked. First, it is NOTICEABLY snappier than Vista Business x64. Maybe because there is nothing set up by default. I almost cried when my Windows Live Writer told me it didn't support Windows Server OS and I thought I...
Microsoft .NET framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1 now have public BETAs. The service pack of Visual Studio 2008 has really interesting stuff. Highlights I'm interested in are performance improvements in HTML editor, collection of JavaScript intellisense hotfixes plus new ones enabling better JavaScript intellisense for libraries like jQuery, JavaScript Code Formatting, ASP.NET Routing engine (the one used in ASP.NET MVC, it is actually developed as separate component),...
Recently, I started developing new applications around the Umbraco Content Management System. I use the term around very lightly, because Umbraco really doesn't require any constraints on your code (like DNN, Rainbow and virtually every other .Net based CMS that I have used), other than the need to develop in user controls instead of aspx pages - which makes perfect sense given the idea of a CMS. It has worked flawlessly and is easily the best .net based CMS system around from a developer AND designer...
I got these two errors after deploying my ASP.Net applications and web services on new testing/production server. I would like to share how I managed to fix them. see details below: 1- Could not load file or assembly XXXXXXXXXX or one of its dependencies. There is not enough space on the disk. (Exception from HRESULT: 0x80070070) Fix: Request form server admins to remove the size quote limitation on the APP Pools users used for those Asp.Net applications. Anther related error: 2- access to the path...
With MIX, and meeting the announced MVC roadmap, the new versions of AS.NET Extensions are now publicly available.ASP.NET MVC Framework Preview 2 is available also as separate download, same as Silverlight 2.0 BETA 1 (and Expression studio, Silverlight VS 2008 Tools). Download Links: ASP.NET 3.5 Extensions Preview 2 ASP.NET MVC Preview 2 Silverlight 2 Beta 1 Expression Studio 2.0 Beta Silverlight 2.0 Tools Beta 1 for Visual Studio 2008 UPDATE: Silverlight 2.0 Beta 1 SDK UPDATE: Internet Explorer...
March 2, 2008 - The Day that I was recognized as one of the ALL STARS in ASPNET Technical Community Hall of Fame! Technorati Tags: Community...
Introduction This article shows on how to generate a chart (a graphical representation of data) using the aspnet ReportViewer control. Basically, this report is called an rdlc file “Local Mode” which means that a report is generated at the client side and no connection established to the Sql Server Reporting Service Server. In this example, I am creating a report(chart) that would display the stock out movement. The page includes a DropDownList to allow users to filter a specific stock category that...
Note: This is ported from my old weblog. Originally published December 19, 2005 This is a well commented example for a GridView with implementation of RowDataBound and DataBound events. I also demonstrate in it some of the important properties of GridView, like the slight diffrences when dealing with Grid Paging, Rows, Cells, and Columns. I prefered to heavily comment the code than to write separate paragraphs describing it as I do believe that the code is what gets the idea in a direct way. The...
Mutex Could not be Created. Some time while running ASP.NET web application through Visual Studio you might receive following error Server Error in Application. Mutex could not be created. Few workaround for “Mutex Could not be Created.” Interview Questions | ASP.NET Interview Questions | .NET Interview Questions ASP.NET 2.0 Interview Questions | .NET 2.0 Interview Questions | SQL Server 2005 Interview Questions “Mutex Could not be Created.” Solution number 1 1. If your visual studio 2005 is open,...
Background and Problem Recently, I developed a website which implements PKI infastructure. On Click of a Button I sign and encrypt a document and send to desired location. During the development I have put the signer certificate in my "Certificates-CurrentUser" store and worked good. But when I deployed the site in production I found that IIS cannot locate the certificate from "Certificates-CurrentUser" store.Initially I wrote this code and which was the CULPRIT:object locationCertificate = "SomeCertificate";X509Store...
Possible Cause:- When you install IIS AFTER .NET 2.0 framework, the rights of the ASPNET user had not been set correctly. Resolution Repair (Uninstall if repair does not work for you) .NET Framework 2.0 Simply run the following from command line to reset the IIS registry settings for aspnet user. Usually framework directory for .Net Framework 2.0 resides under C:\WINDOWS\Microsoft.NET\Fr... References:- http://support.microsoft.co... http://forums.microsoft.com...
2 days back I installed Community Server 2.1 (SP2) with hosting provider webhost4life. They have a very handy Pre Installed Community Server Thing... Just 2 clicks and you get the Community Server Installed...All was going ok and I was very happy with this new hosting provider and about to test the emailsettings so I put the smtp details as provided by the hosting provider and then logged off. Pressed forgot password link and wanted to test whether the forgot password email sending option is working...
I'm going to start a series of short posts on stupid things developers do that they shouldn't. Some of these have been preached for years, some are just developers don't know any better. So here goes...starting with security! #1: Never use the SA account in a production database. I worked with a company that purchased a time and billing database that was developed as a web application. Cool thing was that when we installed it, we had to change the SA password per their setup guide. When we looked...
IIS 6 recently popped out an error when I am unable to replicate. I think this will be worth noting here for the sake of those who had the same encounter or who doesn't want to spend too much time debugging a "it should work" problem. This problem and it's resolution is documented in MSDN here. However, for some reason, the recommended methods did not solve my encounter. Here are the steps to first created this problem, note that subsequently the same steps will no longer reproduce this error. Create...
Trying to figure out the best way to connect to SQl Server express for VS2005 Web development is quite interesting. You may be able to connect from vs2005 and the new SQL Server Management studio but when it comes time to run your aspx page against a connection you need to do a little extra work. First thing is security. If you are using integrated security the ASPNET account needs access to your database. I found there is more than one way to do this which adds to the confusion. Option 1) Attach...
Few days back In my project I have to run a batch file which contains the series of piped MS-DOS commands to deals with Active Directory. Running batch file through ASP.NET requires impersonate the user id (for ASP.NET aspnet account), which requires lots of code and require understanding of windows securities. I found one work around which is very easy and no need of extra coding. In MS SQL Server there is one stored procedure named “xp_cmdshell” which executes a given command string as an operating-system...
I started getting the following error in one of the site that I am recently installing ( win 2000, .Net 1.1)Access to performance data was denied to ASPNET as attempted from C:\WINNT\Microsoft.NET\Fram... Access to performance data was denied to ASPNET as attempted from C:\WINNT\Microsoft.NET\Fram...System.TypeInitializationException: The type initializer for "Microsoft.Practices.Enterp...
The UltraWebChart has two in-the-box options for deployment: FileSystem or Session. The FileSystem option basically writes the rendered chart image to the web servers disk drive, and renders a standard image tag to the web page which points to that image as its src: <IMG id=UltraChart1_BaseImage src="/devin/ChartImages/Cha... .../> While a simple and reliable deployment option, the FileSystem option does have some drawbacks. 1) It requires that you give the ASPNET user Write...
I had to resort to using the web installer as the CS MSI installer didn't work (threw error stating it could not find MDAC 2.7 or above - even though I'm running XP Pro SP2 which has the MDAC components built into it - duh!). Download CS 2 web install & unzip. Edit Installer\default.aspx - modify the line: bool INSTALLER_ENABLED = false;so the installer is enabled eg: bool INSTALLER_ENABLED = true; Using IIS admin, create virtual dir (eg 'cs') pointing to the 'web' dir beneath the installation....
I've tried to work with DotNetNuke Windows Authentication to extend it to work in mixed mode ( Use Windows Integrated Authentication for seamless logon intranet logon and use Forms authentication for users unable to use Windows Integrated authentication), as I did it before for my ASP.NET application . I found that since I activated Windows Authentication, I can logon only as my domain account user,which does not have DNN portal host or admin roles. So I unable using DNN web interface to administrate...
First of all, to be able to follow me up in this post, I think you should take a look at the first part of it before you continue reading. After the session of Dr. Ahmed Bahaa and a quick talk to him, I took a colleague from GNS Egypt and went with her to TOP IT session “Data Access in ASP.NET 2.0”, I looked at the guy speaking out there and returned to my previous belief that I should focus on other sessions than ASP.NET related, as I believed that I’ve seen enough, while there...
Here's a fun question that came through the Arizona .NET User's Group list about using client certificates with ASP.NET: Question:How do you set up a client x509 certificate to be used by code run by an ASP.NET process? This article didn't help: http://support.microsoft.co... The WinHttpCertCfg.exe util would not install certs into the store. I had to use the mmc certificates plugin. The workaround I did in development was to log in as the web user and install the...
The Problem: Recently, I ran across a situation where we have an ASP.NET 1.1 app that we were installing onto a machine with the 2.0 .NET Framework already installed. When the virtual directory was created by the install, all the "non-application specific" file extensions were mapped to the 2.0 isapi.dll file. However, the "application specific" ones were mapped to the 1.1 isapi.dll. So, when I tried to hit the site the first time, a lot of stuff was screwed up. Going into IIS and remapping everything...
Lots of BizTalk developers were facing similar problems when they built their own .NET test applications to test the web services generated by BizTalk Web Services Publishing Wizard. The debugging process stopped at “this.Invoke()”, and usually there will be an error message of “Internal SOAP Processing Failure”. If you check the event log, you will also see an error similar to “The Messaging Engine failed to register the adapter for SOAP for the receive location ...asmx....