.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Losing my mind, trying to publish a site with a .ashx handler

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

Happy Saturday everyone -


I am trying to work on a bit of a new idea to me, using .ashx files.  I understand that .ashx files need to be registered in the web.config, but I am not understanding how that works.

My .ashx file is 'album.ashx'.  My issue is that my site runs properly locally when I test it, I am just unable to publish it (locally or otherwise) - I receive the following error:

There is no build provider registered for the extension '.ashx'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.   


Inside of system.web I realize that I need to register this file, and using a template I found online this is what I have so far:




View Complete Post

More Related Resource Links

When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

How do I publish public facing SharePoint site(on internet)?

I developed public facing SharePoint 2010 portal publishing website using Window Server 2008 R2 and SharePoint 2010 Server and SPD 2010 on my computer. I have custom master page, page layout, css…. I want to publish it(on the internet).  I want to know cheap host and domain name service provider Company and steps to do it. I’ appreciate any advice in advance.

ashx handler using jquery autocomplete

Hi, i have using jquery for autocompelete option and iam using ashx file , i have 2textbox  , i need to show diffrent search record in the text box, iam using 2 ashx file to show the value using jquery, i want to user single ashx file instead of iam using 2 ashx handle filercan use switch case to handle this , i want to use 7textbox  all textbox i need to do autosearch, how to handlethis senario using jquery and ashx handler file below the code this is my codebehind query clsquery.updatetablestring = "select top 2 Cont_number from ASPrearrival_list where Cont_number";         clsquery.updatetablestring = "select top 2 custid,custname from ASCustomer where custname"; // this is my auto search iam using 2 handler file , i wants only one handler instead of 2handler <script type="text/javascript" src="jquery.autocomplete.js"></script>      <script type="text/javascript">       $(document).ready(function()       {                       $("#<%=txtcontno.ClientID%>").autocomplete("Handler1.ashx");           $("#<%=txtcname.ClientID%>&q

ASHX Handler + Threads

Hello guys,I have a page named Calculate.ashx, the page will be called every 10 seconds until a complete result is available.I need to start 3 external applications, each to fetch information for me, the whole thing would take about 3 minutes.My question is, how do I start 3 threads and "keep in touch" with them from the ashx code, even though the context of the file will endbecause I have to send a response to client?I'm not sure I am clear so i'll try to explain it again in a different way,when a request arrives to Calculate.ashx for the 1st time, Calculate.ashx will start 3 Threads, each with it's own job.Now i need to answer the client with ResponseWrite or something, and the ashx file flow will end.In 10 seconds, the client will again send a request to Calculate.ashx, now Calculate.ashx needs to check the state of the Threads it created 10 seconds ago,Will these Threads still exist? won't they be deleted because the context ended 10 seconds ago?How do I keep the "pointers" to those Threads?Thank you!Eitam. 

Publish sharepoint site on the internet?


Hi Folks, after reading a few other Q&A's on here thought i'd just have to write one myself and see what sort of responses i got.

I have created an intranet and internet website on a Server2008r2 box with sharepoint 2010. What i want to do is now publish both these on the internet. The intranet one so that people i work with can log in to it and use it for controlling documents and calendars etc, and the internet one so that I have a public accesible website for anyone to look at.

The sites have been created. The server is connected to the internet with a dedicated line. I just wan to get them out there now and start using them.

Noted on one of the other posts i may need an connector licence. Which is fair enough, but really what i want to do just now before i get things out in the open area of the net is just be able to connect to the sites myself for testing from any other internet connection.

So far im having no luck.

Whats the quickest and best route to making sure i can at least access the sites from the internet?

Any help would be great but this is however my first time working with Sharepoint and IIS properly so help IN DETAIL would be even more appreciated.

Im used to just using online hosts and not hosting myself.

User keeps losing Session on Anonymous site?


This code was working before, but something has changed and I don't know what.  I have an anonymous registration page.  On it, I have a CAPTCHA image, with a URL pointing to an ASPX page that is generating the image.  On the Registration page I am generating a 6 digit code to be displayed in the CAPTCHA image, then saving it to a Session variable.  On the CAPTCHA ASPX page, I am grabbing that Session variable and creating the image.  However, the Session is resetting when the CAPTCHA ASPX page is called.  If I debug it, it has a different ID and the variable is gone.

Why is this happening and how can I fix it?  I have Sessions enabled in SharePoint 2007.

Publish and test a WebMatrix web site using a Local Windows Server 2008


I am new to ASP.NET as well as to WebMatrix Beta Razor language.

I am trying to publish and test a Web Site from WebMatrix Beta IDE to a local Virtual Windows Server 2008 IIS Server.

I did install SQL Server Express 2008 R2 at my local Virtual Windows Server 2008 (using Web Matrix Microsoft Web Platform).

Everything works fine till I add a database table to my WebMatrix site.

When I add a database table and Publish to local Virtual Windows Server 2008 IIS Server my WebMatrix IDE

closes unexpectedlly without any error message.

Running my Web Site using WebMatrix IISExpress works fine.

Any help will be very appreciated... 

Site Pages Library Event Handler not working



I have created an event handler for Site Pages library in SharePoint 2010. In event Handler I have given the list template id (119 - wiki web page library) but the event handler is not working. Do I need to use different list template id for this.?

Web site hangs after publish


Developing a website in ASP.net. 

On the development site all is working fine.

We decide to publish the site using visual studio 2008’s publish mechanism.

The publish goes flawless.

When we go to the live site, it hangs anywhere from 2 minutes to 30 minutes before it starts serving pages.

All other sites on the same server seem to work fine.

If we reboot the server it starts serving pages right away.

It is not a programming issue, as once the site kicks in all seems to work fine.

Any Ideas?

Event handler firing for one site but not for another



I have an event handler that is working just fine on a list in one site, but when I bind it to the other list in another site, it binds properly, but never fires. Any suggestion? 


Getting elevated site in Event Handler



In ItemCheckingIn and ItemCheckedId event handlers, I need elevated site since I'm deleting / adding new documents.





public override void ItemCheckedIn(SPItemEventProperties properties)


using (SPSite site = SecurityHelper.GetElevatedSite(properties.ListItem.Web.Site))
		using (SPWeb web = site.OpenWeb(properties.ListItem.Web.ID))
			// do some strange things			

catch{ }


But according to the best practices, Its a bad idea to instantiate a new SPSite and SPWeb object. (obviously, for performance reasons..)



Since I need elaveted web in both event handlers, I'll have double performance penalty. I was thinking to make us of caching, but SPSite or SPWeb is not thread safe, so cannat be cached..


Is there any better way ?

Adding a messagebox to an ASHX Handler


Is it possible to add a messagebox to an ASHX Handler? I used a handler to pass data from a Web Service to an internal system and need a messagebox to pop up to ask the user to choose from one option or another. 

Files won't download from ASP.NET site when the site has a custom HTTP Handler mapped to the file e


When I have a HttpHandler class in C#/ASP.NET mapped to a file extension in IIS any file with that extension fails to download/display in web browsers (it's downloaded as a 0-byte file in some browsers and nothing at all in other browsers).  After removing the application mapping for the HttpHandler in IIS so it doesn't call the IHttpHandler class in C#, the web browser downloads the file successfully.

This was tested with an IHttpHandler class in C# that has an empty ProcessRequest method. Any ideas on what the problem could be?

How to consume api webservice of another site and publish content on my own page?



I would really appriciate if someone could show me example of how to use api webservice of another site and retreive content (or whatever data is returned) and publish that content localy on omy own site. Api webservice I´m planning to use has support for HTTP GET & POST and SOAP 1.1 and 1.2.

I created my site with webmatrix and razor.I tryed searching on the net but I'm having hard time finding relevant content. Perhaps you can advise me what words to search for?

I hope you can help me.

Many thanks!







ASHX Handler KeepAlive SQL Connection?




I have an ASHX Handler file, the file is connecting to an SQL server


SqlConnection con = new SqlConnection(SQL.ConnectionString()); 


I send request every 1 second to this ASHX page.

Now my question is, is it neccessery to keep the connection with the SQL alive?

Is request every 1 seconds is too much?

Any suggestions?




How to publish all the draft documents in SharePoint site Collection




I have filtered all the draft documents using the “All Draft Documents” view in our site collection. It gives me a good list of draft documents in site collection.


Unfortunately, I’ am not able to publish all Draft documents at one shot as the “Approve” option is greyed out.


Is there any way to approve all the documents at one time instead of one at a time?


Problem with Web Handler - Code works as .aspx, but not .ashx


I'm trying to cover a page that is code-only to a web handler. However, I'm having problems figuring out why the code works when used in the code-behind for the .aspx file but not the .ashx page.

.ASPX Page Code Behind


Partial Class launchsite
    Inherits System.Web.UI.Page

    Protected Sub Page_Load() Handles Me.Load

        If Len(Session("UserDashboardURL")) > 0 Then
            If Len(Session("UserCurrentShowNumber")) = 0 Then
                Response.Redirect("~/development/content/dashboards/" + Session("UserDashboardURL"))
                If InStr(Session("UserDashboardURL"), "?") = 0 Then
                    Response.Redirect("~/development/content/dashboards/" + Session("UserDashboardURL") & "?ShowNumber=" & Session("UserCurrentShowNumber"))
                    Response.Redirect("~/development/content/dashboards/" + Session("UserDashboardURL"))
                End If
            End If
        End If

    End Sub

End Class



<%@ WebHandler Language="VB" Class="Handler" %>

Imports System
Imports System.Web
Imports System.Web.HttpContext
Public Class Handler : Implements IHttpHandler
    Public Sub ProcessR
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend