asp.net

How can I add callbacks to jquery validation (when used in MVC 2)

I'm using jquery for validation in my MVC2 web app (as described here) and I'd like to wire up some callbacks that the jquery validation plugin supports, like invalidHandler, etc. I can manually edit the MicrosoftMvcJQueryValidation.js and add my callbacks (in __MVC_EnableClientValidation, in the options variable) but I was looking for ...

Help me decide whether to use ASP.NET default membership/roles providers or write custom providers

I spent a good part of yesterday reading up on the subject and still feel like I am uncertain which way to go. I come from a "roll your own" background when it comes to authentication and authorization. We never used Forms authentication, let alone the Membership API. Looking at our old code we would use session variables to capture/c...

How to configure url rewriting in IIS6 to consider /my_directory/ like a page?

I'm working on Windows Server2003 with the following: IIS6 .NET Runtime 2.0 ASP.NET C# I've got some pages like these: fr.mywebsite.eu/productA/sub_product1.html fr.mywebsite.eu/productA/sub_product2.html fr.mywebsite.eu/productB/sub_product14.html fr.mywebsite.eu/productC/sub_product26.html The directories prod...

How can I call an aspx page and have it return an image?

******Editing post to newer code sample based on comments******* So, to be clear, I have two files. The first file is called FinalImage.aspx and here is the code for that page: <html> <body> <img src="newpage.aspx" /> </body> </html> newpage.aspx has the following code, based on Jason's sample in the comments below: <%@ Page...

How can I trace an apparent memory leak in an asp.net application?

Some background info: We have several websites running on a 64-bit machine with IIS6 These websites all have the same core code, but different skins and content We have a SQL 2005 database which is fairly heavily used throughout the site Historically we've used SQL stored procs, but have been gradually transitioning to NHibernate. The ...

ASP.net dateADD help

Hey all, i have the following code to populate a dropdown to coinside with a companies 2008-2010 calander year. This is the output: 2008 Period 1: 11/30/2008 - 12/27/2008 2008 Period 2: 12/28/2008 - 1/24/2009 2009 Period 3: 1/25/2009 - 2/21/2009 2009 Period 4: 2/22/2009 - 3/21/2009 2009 Period 5: 3/22/2009 - 4/18/2009 2009 Period ...

Getting Request timed out error when uploading large files.

We have page that allows the users to upload documents (multiple). When the upload takes a long time - either due to the size of the files or due to slow upload speeds - we get a exception saying "Request timed out". We found that the exception is thrown as soon as the upload is complete. So we have modified the executionTimeout config...

writing audit records of pre and post values

I'm currently using an SqlDataSource in ASP.NET/C# to let users insert, delete and update entries in a table/gridview. Every event needs to be written to an audit table. I have easily implemented inserting and deleting - when inserting, the main info audited is just the parameter values of the insert query (e.Command.Parameters[0].Value...

Simple problem storing strings into a database

Hello Fellow Programmers For my website I've just implemented tinyMCE for my site (just a word processor). Everything works fine except when i try to store the string variable input into a sql server database. I want to store a string and not have the html tags make me exceed the 8000 length limit(the html tags take up most of that spac...

The Role Manager feature has not been enabled.

Got the ProviderException : The Role Manager feature has not been enabled. So far so good. Is there somewhere a method that can be called to check if the Role Manager has been enabled or not? ...

How to get Custom Error Pages working for Classic ASP with IIS 7 Integrated Pipeline

I'm working on a website with legacy Classic ASP pages (being converted to ASP.NET on an as needed basis) and new ASP.NET pages. Use of IIS 7 Integrated Pipeline has been very helpful with our configuration. For example, we were able to get forms authentication working auto-magically with the classic ASP pages simply by configuring the a...

web.config authorization deny unauthorised

I am developing a .NET for ASP.NET Web Application and am trying to deny all users who are unauthorised from accessing my application but allowing them only to the login page. Below is a snippet of the code which is inside my system.web section: <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="60" name="APPNAME" ...

Using GUID with SQL Server and NHibernate.

I'm running NHibernate and SQL Server CE I am trying to use GUIDs as my ID column. This is the code I already have: Mapping: <class name="DatabaseType" table="DBMON_DATABASE_TYPE"> <id name="Id" column="DATABASE_TYPE_ID"> <generator class="guid" /> </id> <property name="DispName" /> </class> And this is the cre...

Why does LINQ to SQL think think that my new object is null when I try to add it to the database?

I am trying to add a record to my database table using LINQ to SQL and ASP.NET MVC 2. The snippet in my controller that populates the LINQ object is this: /* other code removed */ if (ModelState.IsValid) { var stream = new Genesis.Domain.Entities.Stream(); // Handle stream // Is this...

I want to move to something new...

Hi, Currently I'm a .NET developer, I've been working with WinForms, WPF,a little with ASP.NET, Silverlight and recently with raw HTML/JavaScript/CSS and using IIS/.NET as server side only. And I've really enjoyed this last one, because now I understand what ASP.NET is doing under the hood, and that has made me a better developer, I thi...

Deleting a directory

I'm having some major trouble deleting directories. I'm working building a ADMIN tool to delete directories that my clients create but then ask to delete them. You would think this is simple: using (var context = Impersonator.LogOn(user, password, domain)) { try { dir = new DirectoryInfo(path); dir.Delete(tru...

MVC route with array of homogeneous parameters

I trying to create routes for a resource with an array of homogeneous parameters. URL would look like this: products/category/{categoryId1}/{categoryId2}/.../brand/{brandID1}/{brandID2}/... And would like an action method would look like this: public ActionResult GetProducts(IList categoryID, ILIsts brandID) {...} where category and...

Delete User from AD Group

Hey, I am trying to delete a user from an Active Directory group via code. Getting the helpful error of: Exception has been thrown by the targe of an invocation" Trace: Stack Trace: at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) at Active_Directory.RemoveUserFromGroup(String sInUs...

w3wp crashing out

Hi, One of our web servers is suffering from random w3wp.exe crashing and after a couple of weeks of debugging i simply cannot figure out why. The only thing that has helped so far is reducing the max worker processes from 15 to 5 however this isn't ideal as we are using a multi-cpu machine in the hopes of reducing the total number of s...

Emulating asp.net FileUpload to work in all browsers

I am writing an application that is used internally inside our network to upload data from an Excel spreadsheet into a database. I don't want to upload the file, but I want to allow the user to select a file from any location on a network. I've built this to work fine using IE, but as many others have noted in their posts, other browse...