Tag | aspnet Posts

It's important to understand the account that IIS is running under when you need to make changes to the security settings. If, for example, your Web application writes to files or to a database, you'll need to grant the correct permissions to the folder or database. Before you can change these security settings, it's important the know what account IIS is using. This FAQ details the various options available, both for "classic" ASP and ASP.NET applications. There is a big difference between classic ...
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 ...
Few months ago I wrote an example about Dynamically Adding TextBox Control to ASPNET Table. As a recap that example demonstrate how to generate rows of TextBoxes in a Table control based on the number of rows and number of columns provided and as well as print the values entered by the user using the Request.Forms collections.. Recently,one of the user is asking if how are we going to accomplish the same thing by generating the TextBox in the Table based on the data from the database. So in this ...
I've been seeing many developers in the forums asking: How can I display a message box from the server (code behind)? How can I customize the javascript confirm and alert popup? How can I display a message box like in windows application? As some of you may already know that displaying a pop-up message box has always been a pain for most developers in web programming. Everyone has probably used the Page.ClientScript.RegisterS... or the ScriptManager.RegisterClien... method to call ...
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" ...
I was playing around with ASPNET AJAX MaskEditExtender control and ASPNET Validation controls when I was working with a profile page and doing some input validations. Everything seems to be fine until I was told to always retain the phone mask format in the TextBox. Here’s my code for Phone number masking: <asp:TextBox ID="TXTPhoneNumber" runat="server" MaxLength="13" ValidationGroup="GroupA" /> <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TXTPhoneNu... ...
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 ...
Recently I have encountered a question at the aspnet forums asking if how to select only one RadioButton vertically and horizontally in a Table.( see this thread). As you can see from that thread, the first solution that I was provided was to use a RadioButtonList Control because it allows you to set the RepeatColumns, RepeatDirection and RepeatLayout attributes. But unfortunately that doesn't actually meets the requirement of the Original Poster (OP). Basically the OP wanted to Select only one RadioButton ...
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 ...
This example shows the enhanced version of my previous example about Creating Custom WebPartZones with Custom verbs (Move right/ Move Left). One of the most common issues with ASPNET WebPart in ASPNET 2.0 is the drag-and-drop functionality in firefox. As you may know the drag-and-drop feature of WebParts will not work in firefox once it is placed inside an UpdatePanel control. So in this article, I will show how are we going to move certain WebParts in different zones without the drag and drop functionality ...
This example demonstrates on how to apply Skins to ASP.NET WebParts. Before we begin let us first understand the concept of the skins in ASP.NET. What is a Skin file? A Skin enables us to modify any of the properties applied to the server controls in our ASP.NET page. Skins can work in conjunction with CSS files or images. To create a Theme we can use a single skin file in the Theme Folder. The skin file extension should be always .skin. For more information about ASPNET Themes and Skins then have ...
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 ...
This demo describes the different approach to display a confirmation message when deleting a row in GridView and pass the id of the item to the confirmation message. Confirmation means a user is asked first if he/she wanted to delete a record by choosing an option (OK and CANCEL). In this demo, we use the JavaScript confirm function for displaying the confirmation message. Now let’s create our JavaScript confirm function. To do this switch to ASPX source and add the following code block within the ...
This demo is a continuation of my previous example “Binding GridView with Data”. If you are not familiar of binding the GridView the ado.net way then I would suggest looking at my previous example first before you proceed to this example. Basically, this demo describes the basic way to do INSERT, EDIT, UPDATE and DELETE data in ASPNET GridView Control using the ADO.NET way. STEP 1: Creating a DataBase Table In this demo, I presumed that you already have a basic background on how to create a simple ...
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:
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 ...
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... The type initializer for "Microsoft.Practices.Enterp... ...