Asp.net .ashx error in sharepoint - asp.net

I am trying to shift my asp.net 3.5 application (C#) to sharepoint.
I have used one .ashx(web handler) file for multiple file upload control in my application
Now it works perfectly locally in asp.net but when i do the same thing with sharepoint with no change in code it stops working.
I dont know if i need to add some dll or any supportive file to get that file upload page (using .ashx file) working in sharepoint
Please help

Your are not adding your handler to sharepoint's web.config ...
like
see my post for what i did to make it work Custom Httphandler in SharePoint

Related

How to update a Kentico Aspx Template Page?

I created a template page, and a page that uses that template in Kentico. So I edited the aspx template file, but the changes arent being updated when viewing the page in the CMS. I turned off caching and everything, but I cannot get my changes viewable.
If you use web application (there are .designer.cs files in your solution) you have to rebuild the app. Or you can try changing Codebehind to CodeFile in your aspx markup.(Not really clean method but will ensure file gets build dynamically as they do under web site).
If you use web site and you tried to delete cache (CMS Site Manager->Administration->System->Clear cache) you are doing something wrong, believe me.
As a last resort you can try to clear asp.net temporary files
(C:\Windows\Microsoft.NET\Framework64\your version\Temporary ASP.NET Files). This will need IIS to be restarted.
Differences between web app. and web site are described here.

Adding a stand alone ASPX page to an existing web application (.Net 3.5)

I downloaded the file discussed in this article and tried "dropping it into" a production web site, but got the following error when I tried to access it through my Web browser:
[HttpException (0x80004005): The file '/WebResources.aspx' has not been pre-compiled, and cannot be requested.]
If I drop the file into webs on my local machine, it runs fine. How do I pre-compile this single file without re-publishing the whole application? Is there something that I can do to pre-compile just this one page. (Note: It doesn't reference any external controls, Masterpages, etc.)
One lazy solution for your problem (without checking the source of the error) is to view the page inside an iFrame.
<iframe src="/WebResource.aspx" width="100%" height="100%">Your browser does not support iFrame</iframe>
but if you need that page to interact with controls outside of its scope, then you will need to look into the header part of the ASPX and make sure that it inherits from the proper class, and is part of the Web Project that is calling the page.
This is pretty easy to do.
Put the file into it's own web application project.
Publish the project to a local directory.
Copy the file and associated assembly to your existing web application. Take care NOT to overwrite your web.config.
Done. This new file now has access to everything your other web app does.

Asp.net Web Service CS file moved?

I hardly use web services, but just noticed now when I created one, the CS file was dumped in the App_Code folder. Is that a new thing?
I always thought it behaved much like an Aspx or Ascx file with the nested code behind CS file.
That's because you are using a Web Site in contrast to Web Application. Web Sites are compiled dynamically at runtime by the ASP.NET runtime. In this model all code goes into the App_Code special folder. When deploying you need to upload your source code as well.
On the other hand a Web Application is compiled. You can place the code wherever you like and for things like .ASPX, .ASCX, .ASMX, .ASHX, ... Visual Studio nests the code file next to the markup.

adding pages in live asp.net site dynamically without redeploying or recompiling?

Is there some way to add .aspx pages in live asp.net site without need to recompile or redeploy ? Please guide me.
thanks
I do not exactly understand what do you mean by "no recompile or redeploy", but:
If you use Asp.Net web site(and not web application) you can just copy aspx file with it's cs file to the web site directory and it will work.
You can simply upload aspx and cs page to the given location. If you publish your site you can upload only page related dll and aspx page.

Embedded Resources and ASPX pages

Is it possible to embed an aspx page (self contained, no seperate codebehind file) into an assembly, in this case a SharePoint web part, and have it still act as an aspx file when called via the resource url?
Regards
Moo
no as such. however you can change you web part to a user control and enbed that in a webpart and a a aspx file.
Google for "user Control Web Part"
OR
you can look at "son of smartpart" but I don't like this approach. not very pure.
OR
Leave it as a aspx page and use the page viewer web part to load the aspx page in an iframe from sharepoint.
Download the Web Deployment Project update from MS, and it will solve your problem.
http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en
You could use an httphandler but then you would have to make changes to web.config. What is your real problem? You can easily deploy a separate ASPX page when you use something like WSPBuilder to create your SharePoint code.

Resources