asp.net

Restart ASP.NET application when folder contents change

I'm writing a web application that will have "plugins". The plugins will be .DLL files which will export their functionality through predefined interfaces 'n stuff. All the .DLL files are in a folder called "Plugins", and the ASP.NET application loads them all upon startup (by using Assembly.LoadFrom). The problem is that when developin...

ASP.NET ListView select and highlight line through checkbox

I am trying to get an ASP.NET 3.5 ListView control to select and highlight lines through checkboxes displayed in the first column. If I use an asp:LinkButton instead of a checkbox, the line selection is supported automatically through the LinkButton's property CommandName="Select". How do I do that with the checkbox? And as soon as I man...

DataBound DropDownList in DataGrid - order of binding

I have a DataGrid that looks like this (slightly simplified here): <asp:DataGrid ID="grdQuotas" runat="server" AutoGenerateColumns="False"> <HeaderStyle CssClass="quotas-header" /> <Columns> <asp:TemplateColumn> <HeaderTemplate> Max order level</HeaderTemplate> <ItemTemplate> ...

Using Application_BeginRequest for url rewriting

Up till now we've been rewriting URL's using a custon 404 page: the url would not map to any file in the site, and we configured the IIS to send 404 error to a aspx page which redirected those url's to the correct URL. Now we want to stop using redirects, so after reading Scott Guthrie's article on Url Rewriting, I want to use the Applic...

Asp.Net ListView how to delete a row without deleting from datasource

Through CommandName="Delete" I try to delete a line from the ListView control but not from the datasource. On Pressing Delete I expect the webpage to reload and show me the updated ListView(with one line deleted). But nothing changes, the ListView will display the same content after pressing Delete. What do I do wrong? : <asp:ListVi...

Confirmation Dialogue

How could I best implement the following scenario? I have a "Next Period..." button which allows the user to close the current accounting period and advance the current period. I would like to do a server side rights check on the first click of the button, and give the user an alert if they don't have the rights. If the user has right...

Which events do/do not fire when a page is returned from the asp.net cache?

I have an App which users have to log into. Once logged in, they may perform a search against our database. Their Identity can affect the search results. I wish to use Cache pages of the results. VaryByParam sounds good for this. However I do not understand the events that do or do not fire when a cached version of a page is returned...

Localize Images in ASP.NET

A couple of years ago, we had a graphic designer revamp our website. His results looked great, but he unfortunately introduced a new unsupported font by the web browser. At first I was like, "What!?!"... since most of our content is dynamic and there was no real way to pre-make all of the images. There was also the issue of multiple la...

Asp.net + JIT?

What is default type of JIT compiler is used in .Net (visual studio) out of (Pre-JIT,Econo-JIT,Normal-JIT)? ...

How do you configure SWFUpload to work with an ASP.NET C# WebService?

Hi, I'm trying to use SWFUpload with an ASP.NET Web Forms project. I need to get at Request.Files[0] But I can't do that in my WebService! Anyone know a way around this? Thanks in advance. ...

URL rewriting problems with ASP .NET 2 on IIS7 and Vista

I've got a website running under ASP .NET 2/IIS7/Vista. I have a URL rewriting module which allows me to have extensionless URLs. To get this to work I have configured the system.webServer section of the config file such that all requests are forwarded to the aspnet_isapi.dll. I have also added the URL rewrite module to the modules secti...

rowindex on gridview control - VS 2008

With a gridview control bound to a sql data source, i want to display a column named ID. The ID should display the row number for each row. How would I go about binding this to rowindex instead of the ID column from the database? ...

How to pass array from Asp.net server side to Javascript function on client side

How do I pass an array I have created on the server side onto the client side for manipulation by Javascript? Any pseudo code will help ...

What would you like to see in the next edition of 'Programming ASP.NET'?

With the .NET 3.5 cycle out of the way and ASP.NET 4.0 on the horizon, it's time to try and figure out a way to incorporate the many new features and techniques that have emerged \ been released into the next editions of ASP.NET books. So then, what would you put in 'Programming ASP.NET 4.0' and what would you NOT put in it? Books are ...

How to choose a databindable grid control

I recently started working with ASP.NET 3.5, having previously worked with C# and WinForms (mostly .NET 1.1) for about 6 years. My head spins every time I need allow the user to view, add/remove or edit a list of items. This is due to the similarities, and differences, of the following controls DataGrid GridView ListView DataList Ca...

How do I use the "Post/Redirect/Get" a.k.a. "Redirect after Post" with asp.net

Doing a refresh after certain action in asp.net seems to make them happen again even when that action doesn't make sense (think double delete). The web way to deal with this situation is to redirect after a post to get a clean version of the page that can be refreshed without reposting an action to the webserver. How can I do this with ...

Using EndRequest Event to close NHibernate Session with IIS 7

I am using NHibernate on a new ASP.NET project, and am running into what I believe to be strange behavior. I am attempting to manage my session by using an HttpModule to catch the EndRequest event and close the session. This is working fine, however, after the EndRequest event fires, I am getting an exception in the OnLoad event of one...

How to have http module on fire events only for specific page types

I have an http module on a sharepoint site and this module instantiates a custom class and add it to the session and does other initial things for my site. However, I'm noticing that the http module is being called for all request types (.aspx, .js, .png, .jpg). Is there any way to have an http module only be called for .net specific pa...

Override DateTime serialization for ASP.NET WebMethod parameters

I am working on cleaning up a bug in a large code base where no one was paying attention to local time vs. UTC time. What we want is a way of globally ignoring time zone information on DateTime objects sent to and from our ASP.NET web services. I've got a solution for retrieve operations. Data is only returned in datasets, and I can...

How to use reflection to create a class in app_code?

I have a class Customer in app_code folder in asp.net web site, how can I create an instance using reflection, for example using Activator.CreateInstance(assemblyName, typeName)? Because the app_code is dynamically compiled, I don't know the assembly in design time? Thanks Fred The question is should be how get a full name of type in d...