Suggested Directory Structure/placement Of ASHX Files?
Mar 18, 2011
I'm looking much more closely at the idea of universal conventions over configuration for my projects (versus 'home-rolled' conventions, or grabbing from a variety of conventions).However, I'm not seeing much, if anything, about the preferred location of ASHX files in, for example, ASP.NET MVC projects (as well as Web forms projects).
Is there a recommended directory structure for these? Perhaps there's a published specification with a much larger directory structure accounted for?My personal convention has been to place these within a top-level Handlers directory, but I honestly haven't personally seen any other projects that really do this.I suppose, depending upon what it does (for example, generating an image), that one could argue this might go into the Content directory, but it seems this directory is generally used for static files.(Aside: One could argue that ASHX files are not needed in MVC projects, but based on questions posted here, it appears ASHX files still have their place in MVC projects.)EDIT: Ignore MVC projects, since I'm suggesting that as one example. How about Web Forms, then?
View 2 Replies
Similar Messages:
Dec 13, 2010
I have a large directory structure with JavaScript, images, etc. that depend on each other. I would like to encapsulate it all into a DLL so I only have to reference one thing and not have multiple copies of all these files across projects.
Because the files depend on each other, I'm thinking I can create an IHttpModule that registers a route to accept URLs such as /MyEmbeddedDir/subdir/file.js. Anything in MyEmbeddedDir would then be handled by a custom IHttpHandler that does the correct mapping. Each web application would then need to reference the DLL and add the module and handler to web.config. Does this seem reasonable?Also, is there an easier way to embed/reference the files than to set the build action to embedded resource and add [assembly: WebResource(...)] to each file (there are dozens!)?Edit: If I'm not using WebResource.axd then I shouldn't need to add [assembly: WebResource(...)]
View 2 Replies
Feb 7, 2010
I'm building a site that can possibly have millions of users (yes ambitious!). Each user can upload an image or two for his/her profile. How would you architect the directories to support this type of thing? I was thinking of having a users subfolder off the root dir where each user will have their own sub-dir that corresponds to their userId created at registration time. I could then upload their profile pics to their corresponding sub-directory under the users dir. Seems straightforward but am I missing anything? Can I have a million sub-dirs under the user dir? NTFS supports it so my guess is YES.
View 2 Replies
Jun 14, 2010
I am working on an ASP.NET application which has one data entry form. this form contains one field which takes Path for existing webforms.Suppose i have a form name "XYZ.ASPX" inside my working directory eg. "WEBPAGESXYZ.ASPX"Now my requirement is "Can i have a browsing control which will restrict me to browse pages and user controls in my wrking directory only and not the whole computer"
View 3 Replies
Feb 18, 2011
I am saving relative path of files in my DB as string. I want to create a treeview from this input. There can be multiple folders for a file path.
View 1 Replies
Jul 9, 2010
Can you point me to a url for the proper directory structure to create for a new website?I can create a website project and add class library projects to the solution to create a fully functional website.My grey area is that I need to zip up the web site solution and hand it over to the client.I'd like to make sure that I hand over a solution with the most proper directory structure.I'll run you through a scenario:
1. Select File > New > Web Site > ASP.NET Web Site from the main menu
2. Save with a path of C:ProjectsTestWebSite
3. Right-click the solution in VS and select Add > New Project > Class Library
4. The new class library is added with an automatic path of C:ProjectsTestWebSite (2)MyClassLib1
It seems like there should be a way to create a better structure for this but I'm just not following the correct process. Can you point me to a url with instructions for managing a proper structure for this?
View 1 Replies
Nov 15, 2010
I'm working on an application which will store around 50.000 images within it's first year and another 75.000 in it's second. Images can come from Galleries, news images, article images and profile images. So I want to give each image a GUID and store the GUID in the database.As for the directory structure i was thinking of something like this:
~/Upload/Images/F2/50/F2504E0-4F89-11D3-9A0C-0305E82C3301.jpg
So I'm using the first 4 characters of the GUID as my directory structure to spread images a bit more evenly between directories. Now I have some questions about this approach:Is it considered good practice to store all different kinds of images together rather then use ~/Images/Upload/Profiles, ~/Images/Upload/Articles etc.I'm also storing thumbnails and they have a different GUID obviously so the thumbs will not be in the same folder as the original and somehow that doesnt give me a good feeling but I guess it should not matter but.Same goes for Galleries, I'm used to store galleries in folders like ~/Images/Upload/Galleries/12 , and now all the images from a gallery will be scattered around in different subfolders, is this a big performance hit?Do you guys have any other ideas for directory structures?
As you can probably see I'm a bit afraid to use this approach but since there will be lots of images maybe even more then the numbers i gave i have to let the control go I think :)
View 3 Replies
Feb 23, 2010
I have ASP.NET page with an iframe on it for displaying some pdf reports on this page. When user select the report type from dropdown, I add the needed for report data into the ASP.NET Session and change the attribute "src" of the iframe to .ashx module address which generates the .pdf report.But if Adobe glug-in for viewing .pdf files in browser is not installed, browser proposes to save report file and name of the proposed file is "HandlerName.ashx".But I want to make the browser proposed to save the file with the name "Report.pdf".
View 3 Replies
Jan 10, 2011
What is the purpose of Handler (.ashx files) and what is the use ?
can i get any sample ?
View 1 Replies
Jan 10, 2010
on my current contract, they're telling me that they want to store and upload files outside the website structure - same drive, but a different path (like C:Files)
They also want a page inside the website to list them - that part I can do - I use System.IO to list all the files in that folder, and put an HTML hyperlink to each one of them.
However, when you click on the files, they don't open.
The boss tells me this can be done by somehow making this outside folder a share and using impersonation - but I don't get it.
View 1 Replies
Dec 2, 2010
We have a whole bunch of WML pages that are served out using ASHX files and we've had no problems with them. However, someone has just got a Windows 7 Phone and when they browse to one of these pages they get:
Can't download file! Windows Phone doesn't support .ashx files Is there some IIS configuration that we need to do to make this work?
View 2 Replies
Mar 26, 2010
i want to build a custom control using javascript on client side and ashx on server side.
I know about SWFUpload, how can i configure it with ashx on server side.
any tutorial how i can use FLASH objects to transfer files from client to server. i been looking for such tutorial for a while that uses flash object on client side and sends file info using bytes array to the server. also i want to reduce the size of the file on the client side before sending to safe bandwidth.
basically my client side is pure HTML/CSS/Jquery and Javascript using Ajax and my server side is ASP.NET with C# and most ASHX
View 2 Replies
May 11, 2010
I have four categories, which I would like to show up in my breadcrumbs:
ex:
Home > Poems TOC > MyPoem
Home > Songs TOC > MySong
can I structure the xml in the Web.sitemap doc, so that even if the files are in the same directory, they will dispaly as above. (the TOC entries are table of content pages, which call the actual content pages)
View 1 Replies
Nov 22, 2015
[URL] ....
In above link you clearly describe (How to display directory folder structure).
The path only works when the folder insight the project.
When I put folder outside the project it didn't work. What type of changes I need to made to acces the folder outside the poject. & How can I show other details of files which are including in folders Like. Last Modified Created Date, Modified Date etc..
View 1 Replies
May 10, 2010
I have zip files in one directory . I want to iterate through all files and check the file size. If file size <>0 kb then want to move to another directory. How can I do that?
View 6 Replies
Feb 21, 2010
I am developing an ASP.NET 3.5 web application and I have a folder in the project which contains a list of documents which could be pdf or any of the MS office 2003 or 2007 supported file formats. I would like to display these files to my users as thumbnails (just like the way windows displays files). And when the user clicks on a file it has to prompt them to either save the file or open in the browser itself. How can I achieve this?
View 2 Replies
Jul 25, 2010
By default ASP.NET's compiled files (Along with VB or C#) are saved and created in
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesoot...Is there a way to change it? or is it recommended to keep it at default?I am asking about changing it because what if you format the c drive? or some other reason as keeping functional files in a separate folder away from windows files.
View 1 Replies
Sep 7, 2010
I use TabContainer of Ajax Toolkit and want to have tabs both in buttom and top of tab container. So that we have tabs in both buttom and top. also is it possible to have other elements besides tabs? I mean If I have a datalist in tabs and want to put their paging on header and footer of tab container just beside the tabs.
View 3 Replies
Jun 16, 2010
I have a master page that links to a CSS. I have read several blog posts regarding "liquid design" in an attempt to place my footer below the content. I have not been able to make this work thus far. Here is a snippet of code. The footer, which is defined as an element in the linked CSS, contimues to reside above the two columns. I think that the problem lies in the placement of my <div> tags but I believe that I have tried all possible variations and still the footer remains near the top of my page.
[code]...
View 3 Replies
Jan 15, 2010
In my project i am uploding images and videos using file upload control
My problem is that suppose two users upload two files with same name on the system then how should i distinguish them
and whether I should first save fle or first make its entry in database.
View 2 Replies
Mar 17, 2013
In mu asp.net+vb web there is a page in which i display files from a folder in web. the code i sused id as under
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim filePaths() As String = Directory.GetFiles(Server.MapPath("~/Result/comn/"))
[Code]....
as of now all the files in that directory is displayed . i want to display only pdf files
View 1 Replies
Apr 24, 2010
What is the best place for javascript that is specific to a partial view? For example, if I have a partial view (loaded via ajax call) with some divs and I want to turn those divs into an accordian, would it be better put the $("#section").accordion() in script tags inside of the partial view, or in a .js file in the function that retrieves that partial view and inserts it into the DOM?
Obviously, common methods I will be keeping in a .js file, however I am more talking about javascript very specific to the partial view itself. Most things I find on the net seem to say to put all javascript into a separate .js but nothing addresses the idea of partial views.
View 1 Replies
Aug 31, 2010
Reorder list to do control placement
[Code]....
View 4 Replies
May 29, 2010
I am seeing temp files created in my wesite directory. The files are attributed to a page that I load from a txt file for more info. I beleive when I user clicks on the more info link and I read the textfile into the page it creates the temp file named somthing like this moreinfo.aspx~RF1630b1e.TMP does anyone know a way to clean these up other than a manual task? below is the code I use to read in the txt file
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim strURLNAme As String
Dim MyFileName As String
strURLNAme = Request.QueryString("AdultInfo")
' Response.Write(strURLNAme)
If strURLNAme = "adult" Then
MyFileName = "AdultMoreInfo.txt"
ElseIf strURLNAme = "kids" Then
MyFileName = "KidsMoreInfo.txt"
End If
'Open a file for reading
Dim FILENAME As String = Server.MapPath(MyFileName)
'read the file
Dim objStreamReader As StreamReader
objStreamReader = File.OpenText(FILENAME)
'read the entire file into a string
Dim contents As String = objStreamReader.ReadToEnd()
Me.lblNicerOutput.Attributes.CssStyle.Add("text-align", "Left")
'We may wish to replace carraige returns with <br>s
lblNicerOutput.Text = contents '.Replace(vbCrLf, "<br>")
objStreamReader.Close()
End Sub
</script>
View 2 Replies
Nov 24, 2010
in direct regards to my last question.
my css files are located in the app_themes directory.
so im not the one adding the reference to them in the master page.
so how can i implement the solution they gave me in my last question?
View 1 Replies