I want to create a down for maintenance page in asp.net mvc so whatever the request is it will point it to Home/Down
What router configs I need to set in global.cs file?
You could use an App_Offline.htm file. Simply upload an html file with this name to the route of your ASP.NET application and all requests will route to it. When you are ready to put your site back online simply delete the file. There's a small gotcha you should be aware of when using App_Offline.htm file with an ASP.NET MVC application.
Related
I need to upload files in the Workspace:
I dont know which URL i should give as parameter to my file Uploader. Considering that i working with the SAP WebIDE personal Edition and my file are located in the following path:
file:///C:/SAPWebIDE/eclipse/serverworkspace/Al/ALine/OrionContent/testApp/webapp/model/
What should i please set as Url here?
var oFileUploader2 = new sap.ui.commons.FileUploader({
name: "upload2",
uploadOnChange: false,
uploadUrl: "???"
});
I think you have misunderstood how the FileUploader works.
The "uploadUrl" parameter should be used to specify a path on the "web server" (e.g. application server, web container) on which your application is hosted. UI5 is a web user interface framework, it does not know how to handle (server-side) upload requests. This means that the server (backend) itself should have some implementation for handing the file upload.
After you select the file and trigger the upload, a POST HTTP request is made to the path specified in this "uploadUrl" parameter. If you have no web server to know to handle it, then it will invariably give back an error HTTP response.
Based on the title of your question, I understand that you would want to upload the file inside your workspace. IMO, this does not really make sense (as you are mixing in the design time environment with your run-time environment (i.e. your application should never depend on the IDE).
Nevertheless, you can try and import a file via the import menu (right click on package, import, from file system) and see what URL is the request triggered against (using the dev console). I looked around a little and roughly this is the request URL: http://localhost:[Web IDE Port]/xfer/import/[User Name]-OrionContent/[Project Name]. In the Slug header you would have the file name. You might not be able to make a POST request towards this URL directly (because of XSS / CSS limitations), so you might need to create a route mapping for it.
i am developing an excel add-ins using office.js, i want to keep the different configuration settings in the web.config files, and read those settings in the java-script file. how to do that.
is office add-in sample project is MVC asp.net project, should i be returning the view from there and my source location in manifest point to that view.
please guide me to correct approach.
Generally speaking, this is not something that is Office Add-in specific. You would you would use the same approach as with a regular website. For example, see Reading web.config from JavaScript.
In terms of the manifest start URL, you can point it at any web-browsable page, it doesn't have to end with .html. So you can use an aspx or MVC view page. Alternatively, you can have an html/js/css page that makes an AJAX web service call to your own web API that returns you the settings. If I may recommend, see my blog post for how to create a web service for an Office Add-in using the ASP.NET Web API.
Hope this helps!
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT
I have a website that lives within a folder one level off the root of the website. This was done because it used to host multiple web applications, but the other application has been retired and now the domain is used for just the site. We want to move it out of the folder and into the root of the domain
Current: website.com/main/page.php
Want: website.com/page.php
The issue is all the links that are out there that have the old location. I would like to have a .config file that lives in the old directory and have it re-direct to the link by just removing "main" from the URL. What is the best way to go about doing this?
One way of doing this is by using HTTP redirect
This method is explained in this video: https://www.youtube.com/watch?v=wC3kJnhlofw
I have an MVC2 web site which I am trying to get working offline on an iPhone. All pages in my site use the same master page, and this references the single cache manifest file. None of the specific MVC urls are present in the manifest file but that is ok for now because they will get cached once they have been visited once (they get cached on initial download).
My problem is this: if I have a url of www.mysite.com/red or www.mysite.com/blue then the page gets cached on the iphone. If I have a url of www.mysite.com/red/one or www.mysite.com/blue/two then the page does not get cached.
Does anyone know why this might be happening?
Thanks very much.
The url of the files listed in a cache manifest are all relative to the location of the file that includes the manifest, not the location of the manifest itself.
If your site is structured like:
www.mysite.com/red
www.mysite.com/blue
www.mysite.com/red/one
www.mysite.com/blue/two
www.mysite.com/scripts/site.js
www.mysite.com/css/site.css
www.mysite.com/cache.manifest
And your cache.manifest currently looks like
CACHE MANIFEST
scripts/site.js
css/site.css
It will work for www.mysite.com/red and www.mysite.com/blue .
To make that same cache manifest work for www.mysite.com/red/one or www.mysite.com/blue/two, you should change your manifest to use absolute urls, like this:
CACHE MANIFEST
/scripts/site.js
/css/site.css
I know that I can use normal html files in ASP.NET MVC; however I have a situation where several (above 20) html files are needed for static display. This is fine and good, but I really don't want it cluttering the MVC project since none of them will have controller actions.
Is there any way to load up a second project and use static html files from it, within ASP.NET MVC?
I know my answer is not directly related to your question as you are asking how to access HTML pages from a second project. But an alternate would be to place the html files in your content directory. This way you could catalog your static html pages
For Instance:
MVC Directory Structure
Content
images
logo.png
script
utility.js
staticHtml
static.html
static2.html
Model
Views