Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










MVC :: Putting The JavaScript File In The Views Folder?


I do have many JS files that are unique to various aspx (Views) pages (they are the js containing the event handling for the pages for example). I'd like to put the JS files in the same folder as the aspx files (so in the Views/{action}) folder. How can I do it? It seems that the Views folder isn't directly accessible from outside, I tried using the IgnoreRoute but there isn't much documentation about it.

To reiterate: I'm already using a "generic" Scripts folder for the "generic" scripts (jquery library etc.)


View 1 Replies (Posted: Sep 25, 2009 08:14 AM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
MVC :: Accessing Views In The Views Folder Without Controllers In Place?
I was just structuring an already existing web application. I just created all the view files and the placed them under the Views folder. However, i have an aspx page, which refers to these files directly as in the case of a web application. I am aware of the fact that, this is not a good practice. However, I would like to know if it is possible to access the Views directly. I know that the web.config in the Views restricts the use of the files in the Views folder. Is there any way that I can access the Views directly without they being called from the controller?

Posted: Dec 28, 2009 07:50 PM

View 3 Replies!   View Related
Web Forms :: Putting Dlls On Website's Assembly Folder?
How can I put my own dlls on the web-sitein the hosting assembly folder, if I hire an hosting space on some computers on the internet.

i.e : Using Plex, for Windows 7, Framework 3.5, ASP.NET.

Posted: Oct 30, 2010 02:25 PM

View 5 Replies!   View Related
MVC :: Add A Sub Folder Within The Views Folder For A Controller?
How can I add a sub folder within the Views folder for a controller?

I have a controller named "admin". In theViews folder, there is an "admin" folder.

The admin controller has a number of actions. For each group of actions, there is a partial class that contains the actions of the group. admin/reports, admin/inventory, admin/orders, ...Problem is, when I move the "ReportsIndex.aspx" view into folder Views/Admin/Reports, MVC says it cant find the view when the ReportsIndex action method does a "return View("ReportsIndex", model) ;".

Posted: Oct 26, 2010 01:01 PM

View 2 Replies!   View Related
How To Save File In Particular Folder Using Javascript
I want to save file in particular folder .

how can i do this ?

Posted: Feb 9th, 2010, 11:22 PM

View 3 Replies!   View Related
Javascript - Jquery / Get The Number Of Images In A Folder Where The First Two Characters Of The File Name Are XX?
I have been looking for the best way to obtain the total number images in a folder where the first two characters on the file name are XX and place this number into a variable.So for example - I have a folder containing the following images:

XX-01.jpg
XX-02.jpg
XX-03.jpg
YY-01.jpg
ZZ-01.jpg

So I would populate the variable with 3 in this case.Does anyone know of any way to do this?

Posted: Mar 16 at 13:42

View 1 Replies!   View Related
MVC :: Web.config In Views Folder?
I had just a little question. I create an empty MVC 2 web site and in the Views folder there is a "web.config" file why? why in "Views" folder and not in the "Controllers" folder?It's not a big problem for me, but i just want to understand

Posted: Dec 30, 2010 09:02 PM

View 2 Replies!   View Related
Automatic Photo Resizing / Program Takes The Photos And Saves Them Into The Correct Folder While Also Putting The Link In Correctly?
My program takes the photos and saves them into the correct folder while also putting the link in correctly. The only problem I'm still having is that it isn't resizing the photos for me like it should be. Below is the C# code. Any ideas on how to make it resize the photos correctly?

[Code]....

Posted: Aug 28, 2009 02:46 PM

View 8 Replies!   View Related
MVC :: Customize Views Folder Structure In 2?
I am working with Asp.net MVC 2 Framework.My project have 20 modules. In each module wise i want to group the controllers and views. Controller are grouped in folder for each module. but the views are not grouped for each module.Instead of it creating each folder for each controller.x: Countrycontroller ,StateController,CityController these controller under Admin Module.Views are created in Country Countryindex.aspx State Stateindex.aspx City Cityindex.aspx of that i need in the following structure .Admin Countryindex.aspx Stateindex.aspx Cityindex.aspx

Posted: Jun 21, 2010 12:29 PM

View 1 Replies!   View Related
C# - Add The View Into The Views Folder In Main App Project?
I've got my Controllers in its own project, my Models in their own projects, and the Main App in ITS own project, which contains the Views folder.

So when I open up my controller cs file and right click on, say for example, the Details action and choose "Add View", it creates a Views folder within my Controllers project, and adds the view there. I want it to add the view into the Views folder in my Main App project. How in the world do I do this?

Posted: Jan 29 at 23:29

View 1 Replies!   View Related
Web Forms :: Move File From Webserver Folder To Local File System Folder?
I have requirement to copy or move file from webserver app folder to local file system folder (user selected). How is it possible in ASP.Net.

On my page i have textbox and browse button and user clicks browse button to select folder and there is Copy/Move button and when clicked the files under webserver folder should be move to the user selected folder. The webserver folder path is available to application.

Posted: Jan 27, 2011 03:32 PM

View 1 Replies!   View Related
.NET Putting JavaScript In HTML Comment Blocks, Not CDATA?
We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working fine on all our environments (dev, test, IE6 VMs etc.). However, at the customer site the client side validation is not happening.We're currently trying to eliminate all the various factors and along the way we asked them to get their page source and send it to us, and we found something interesting.In our environment, our page has ASP.NET javascript in CDATA blocks:

<script type="text/javascript">
//<![CDATA[
. . .
//]]>

[code]....

This may be a red herring, but I'd like to eliminate it as the cause of the validation issues. whether specific configurations/patches/versions of ASP.NET will make it do this?

Posted: Mar 22 10 at 16:27

View 3 Replies!   View Related
Putting Javascript Source Then Immediately The Page Not Working?
When I put the following code on my page.

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js" />

Then anything below will became nothing.

Posted: Jun 15 10 at 13:02

View 7 Replies!   View Related
Putting Google Adsense Javascript On A Content Page Of A Masterpage?
I am trying to putgoogle adsense onmy default.aspx that has a masterpage. I am not sure I am doing it correctly. Is there a particular place I should be pasting their java script ?

Posted: Apr 27, 2010 04:39 PM

View 7 Replies!   View Related
Web Forms :: Link Button With JavaScript / Window Updates But Does Not Refocus By Putting It Back On Top
I have a link button on my page which has both an Oncommand event and an OnclientClickevent.

The idea is that the oncommand updates some data via a postback and redisplays the page with the updates. The onclientclick event opens a new window.

The new window is named so there is only ever one instance of it.

What I'm trying to do is this.

Open a new window (if its not already opened) and ensure it is on top of the parent window. The new window is a smaller size so the parent window is still visible beneath. On the first occurance the new window opens above, however when I refocus on the parent to click again, the new window updates but does not refocus by putting it back on top.

Posted: Feb 12, 2010 01:56 PM

View 1 Replies!   View Related
Uploading A File And Putting The Filename Into A Database?
I am working on a project where I need to be able to upload a file, and the filename is put into a MySQL database. I thought about using a BLOB-type field for this, but realized that my files would be to big, and not the right type (pdf). I know that the Getting Started forum might not be the best place for this, but I have really only used the VWD Toolbox to drag and drop controls, not done any actual true coding in ASP.Net 2.0. I do understand all the code behind everything (GridView w/ Edit, Delete; FormView to add a new row to the table in the db; etc.) that I have used.

Posted: Feb 26, 2009 01:47 PM

View 12 Replies!   View Related
Does Putting Multiple Classes In One File Impact Performance
Does putting multiple classes in one file impact performance? Has anyone had any experience with this.

I've read various discussions around application structure and logic of where code can be found with regard to design best practice but little has been said as whether there is any negative/positive/neutral impact on performance.

Posted: Feb 17, 2011 02:53 AM

View 4 Replies!   View Related
Installation :: Create A Setup File Which Can Copy A Dynamic Folder From The Setup File Folder
I need to create a setup file which can copy a dynamic folder from the setup file folder (users machine) to Application folder. Ex: I have Setup.exe and images folder(which is different from user to user). Now when user executes Setup.exe this should even copy images folder to Application folder in Program files.

Posted: Jun 11, 2009 02:34 PM

View 1 Replies!   View Related
Web Forms :: Create Folder And Upload File In That Folder On Other Machine Connected In LAN
I am working on asp.net 3.5 in C#. In my application I have to Create folder and upload file in that folder, which works fine on my machine. I want help for create folder and upload file in that folder on other machine which is connected in LAN. code for create folder and Upload file on my machine

string FileName = FileUpload1.FileName;

Posted: Jan 25, 2010 06:51 AM

View 4 Replies!   View Related
How To Restrict Access To A Specific File In The Account Folder Rather Than The Entire Folder
I am ristrcting access to the Account folder using below:

<location path="Account">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>

and access to the Default.aspx using

<location path="Default.aspx">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>

but how do i restrict access to a specific file in the Account folder rather than the entire folder?

I tried the following but did not work

<location path="AccountChangePassword.aspx">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>

Posted: Jan 1 10 at 17:42

View 1 Replies!   View Related
Best Practice For Using JavaScript On Partials And Views In MVC?
I started removing part of a view into a partial so that it could be reused on another view. However, I got stuck because there are some JavaScript functions on the original view that call some of the functions that belong to the partial. It seems wrong to call functions that are defined on the partial from the containing view (and vice-versa). What is the best practice for this situation?

Posted: Feb 25 10 at 15:00

View 3 Replies!   View Related
Configuration :: How To Publish The Cs File Into Root Folder Instead Of Bin Folder
When we select pull down menu Build -> Publish .... website. The cs extension file dropped into bin folder instead of root folder.

Posted: Mar 14, 2011 07:47 AM

View 2 Replies!   View Related
Web Forms :: Copy File From From One Folder To Another Folder With Rename?
i have one folder

ABC

--1.txt
--2.txt

I have to copy this file to another folder

XYZ

--11.txt
--12.txt

how can achive this task in vb.net..

Posted: Sep 02, 2009 08:23 PM

View 4 Replies!   View Related
Best Placement For Javascript In MVC App That Heavily Uses Partial Views?
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.

Posted: Apr 24 10 at 3:58

View 1 Replies!   View Related
Uploading 2nd File To Folder - Don't Create A New Folder?
I got my file upload to work with creating a folder name to store the file in. But, the problem I have now, is if after the user uploads one file (meaning a folder is created and the file is in that new folder), what if they want to upload a second corresponding file. I don't want another folder, instead, I want the files uploaded from this one specific .aspx to go into the same folder instead of two separate folders.

Posted: Nov 20, 2008 02:06 PM

View 1 Replies!   View Related
How To Cut(Move) File From One Folder And Paste To Another Folder
I am trying to move(Cut) one file from one folder and tranfer to another folder using System.IO.

Here is My Code

[code]....

I am getting Error while Doing this - Cannot create a file when that file already exists.

Posted: Mar 06, 2009 06:39 AM

View 6 Replies!   View Related
How To Move File From Folder To Another Folder Locally
in run time iam moving file from folder to another folderit is working in local, but it having the problem in server, i got the problem like this
Access to the path is denied. Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.UnauthorizedAccessException: Access to the ath 'C:InrtrackModulesUserCompletedPDFf79be133-549d-486d-9302-f5f601095027' is denied.ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

Posted: Feb 05, 2009 06:51 AM

View 3 Replies!   View Related
Uploading A File From A PC Folder To A Folder On A Server?
I am trying to familiarise myself with file uploading and I have got a server error message that I don't understand.

After bowsing to find the file which I want to upload, the upload button is pressed. After this there is a long delay and then the error message appears.

The code behind that I am using is given below

[Code]....

Posted: May 14, 2009 08:57 PM

View 7 Replies!   View Related
Web Forms :: Automatic File Reading / Check For New File Everyday And If The New File Is In The Folder Read It
I would like ask you for some ideas how can I write mechanism that will be automatically read files from folder. I don't know how to schedule the write task. I want to check for new file everyday and if the new file is in the folder read it.

Posted: Sep 20, 2010 01:11 PM

View 2 Replies!   View Related
MVC :: Create One Js File For All Views?
With MVC pattern, it recommends to put all javascript codes in one seperate js file. If I have more then one view, and each of them have some js code using JQuery like:

$(document).ready(function($) {
//....
});

How to put those Js code into one js file?

Posted: Jul 14, 2009 04:35 PM

View 2 Replies!   View Related
MVC :: Visibility Of .css File In Views?
I havemodified default MVC app built in Visual Studio. I haveadded some css classes intodefault css file in the Content directory.

In my view I have added divs which are using these css classes but unforunately styles did not apply.

Posted: Apr 28, 2010 07:58 AM

View 8 Replies!   View Related
Move A File From A Folder To Another Folder In .net?
how to move a file from a folder to another folder in asp.net? I have the filename as a string and the directory to copy to there is a saveas command but i cant use it with a string.

.SaveAs(Server.MapPath("folder/" & myfile))

Posted: Jan 22, 2011 04:52 AM

View 3 Replies!   View Related
SQL Server :: Export Table Or Views Into XML File?
how to Export Sql Table into XML File into following Format. Eg

<App_Sports>
<Sport>
<SportcodeID>1</SportcodeID>
<Sporttitle>Action Sports</Sporttitle>
</Sport>
<Sport>
<SportcodeID>2</SportcodeID>
<Sporttitle>Adventure Racing</Sporttitle>
</Sport>
<Sport>
<SportcodeID>3</SportcodeID>
<Sporttitle>Aikido</Sporttitle>
</Sport>
<Sport>
<SportcodeID>4</SportcodeID>
<Sporttitle>American Football</Sporttitle>
</Sport>
</App_Sports>

Posted: Dec 02, 2010 03:38 PM

View 4 Replies!   View Related
MVC :: Retain The Data From Views While Navigating Through Multiple Views?
I am having some 5 views in my asp.net MVC application. I have captured some data from these views. I am navigating through these views using Previous and Next button. I fill the data in View 1 and I go to view 2 and enter the data there and so on.. till View 5. Now the question is if I come back again to previous views , how to retain the data entered there in that view. And I want to submit the data from all the 5 views at a time, once I am done with entering the data.

Posted: Nov 03, 2009 12:22 PM

View 2 Replies!   View Related
C# - Add JS And CSS To Layout File In MVC 3 Razor Website From Partial Views
Im currently using a method that looks like the following code to add script and css files to the head of the Layout file.

[Code]....

My problem is that this is a static method meaning it persists the list of stylesheets and script files.

I need to do the same thing that this does but without keeping it persistant.

I need the lists to be remade on every request since they change from page to page what the look are on that specific page.

Is it possible to clear the lists on every request prior to adding the scripts that are needed or maybe after they have been rendered out?

Update:

The reason for not using a section, RenderPartial or RenderaActions is to prevent the same stylesheet or script file to be added more than once to the Layout file.

The site im building has a Layout_.cshtml with the basic layout. This in turn is used by a View that loops through a list of items and for each item a RenderAction is called that outputs the specific partial view for that item. These partial views sometimes need to add stylesheets and scripts.

As there can be needed to add many different scripts and stylesheets from different partial views a global list for styles and scripts were the only way i thought this could be done so there is a global place to check if a script is allready added to the collection or not and then render them all at once in the order they were added.

Update 2:

The real question is how to do the same kind of function (a global list) but without using a static Extension method.

Posted: Mar 15 at 13:52

View 2 Replies!   View Related
Web Forms :: Browse Folder Path Alone Instead Of Selecting Folder Path + File?
Is there any control which has tobrowse folder path alone instead of selecting folder path + file?any server side or client side control ?

Posted: Sep 02, 2010 04:28 PM

View 1 Replies!   View Related
Added 5 Views In The MultiView But All Views Are Tight Together?
I am learning MultiView control.Here are question:I added 5 views in the MultiView but all views are tight together. I can not drag and drop another control such as text boxes or labels into view area.

Posted: Sep 28th, 2010, 08:48 AM

View 15 Replies!   View Related
How To Copy File From Client Machine To Server Folder Without File Upload Control
I have to copy a file from client machine to server folder without use file upload control.

i tried with WebClient().Like this

Dim onbjweb As New WebClient()
onbjweb.UploadFile(Server.MapPath(serverpath), "POST", LocalFilePath).

Its working fine in localhost.When its deployed in server its not working.

Posted: Mar 25, 2010 12:50 PM

View 2 Replies!   View Related
File Creation And Directory / Create A Text File On The Fly In The Folder Uploads?
i am trying to create a text file on the fly in the folder uploads.

the folder is in the root of the websites directory. here is my c# so far

[Code]....

there is a problem with line 5. I have tried a number of different paths and none of them work.

Posted: Dec 16, 2008 07:13 AM

View 8 Replies!   View Related
Add Folder To Save Path On File Upload And Only Allow Certain File Types?
I have a file uploader I would like to be able to have a folder added to the folder path on upload based on a textbox.text "MapPath("~/Uploads/" + Path.GetFileName(e.filename))"

I haveDim folder as String = textbox.text how do I add folder to MapPath("~/Uploads/"

it currently checks for .xml files how can I add more .doc .gif etc

Dim savePath As String = MapPath("~/Uploads/" + Path.GetFileName(e.filename)) 'Validation for file extension If Path.GetExtension(e.filename).Contains(".xml") Then Return End If

Posted: Jan 22, 2010 10:10 AM

View 2 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved