MVC :: Invoking Action From JavaScript With App In Virtual Directory?

Jan 29, 2010

I have an MVC 1.0 app that makes several AJAX calls from JS files. Originally I was just specifying the relative URL like so:

[Code]....

This works but it feels rather like a hack. Is there any way to do what Url.Action does but in the JS code itself? I've had a bit of a search but I'm having trouble coming up with the correct keywords, or else the info just isn't out there.

View 4 Replies


Similar Messages:

AJAX :: JavaScript Web Service In Different Virtual Directory?

Mar 18, 2010

I've searched far and wide, but can't find out why this is happening. I have a clientside javascript ajax call into a web service that works fine if both the service and the calling page are in the same directory. If I try to move the web service to another virtual directory, I get this:

Exception type: InvalidOperationException Exception message: Request format is unrecognized for URL unexpectedly ending in '/js'.

Here are the relevant code tidbits for the separate directories attempt.

aspx file:

[Code]....

CallYahooQuotesServiceMethods.js:

[Code]....

asmx file:

[Code]....

I tried this in my web.config, but it didn't work:

[Code]....

Authentication mode is Windows. If I have to impersonate to do this, I'm not sure how I'd pull it off with Javascript.

View 2 Replies

Programmatically Invoking Mvc Controller Action From Webforms Page?

Sep 15, 2010

Is it possible to invoke an action on asp.net mvc controller programmatically from a classic webforms page that is not handled by MVC but running in the same web application?

We have a mixed asp.net web application: webforms for page rendering and mvc for ajax calls. But we want to render some MVC views from webform page on the server via the code (not a web request)...

Currently we are doing a web request locally to get the rendered view: is it the right/only way?

View 1 Replies

WCF / ASMX :: GetUser() Is Null When WCf In Virtual Directory Is Called In Parent Directory

Nov 10, 2010

I have a WCF service in a virtual directory that is called in the code behind of a page that is in the parent directory, when i debug the code i can see the wcf service is being called, however when the service calls Membership.GetUser() it alway returns null. The user has already logged in to the asp.net site. When i call the service via jquery it does pick up the correct user, but i need to be able to call it via the code behind as well. I am developing in .Net 3.5 how i can make the Wcf pick up the logged in user?

View 3 Replies

Installation :: Development To Web Movement: Directory Listing Denied - This Virtual Directory Does Not Allow Contents To Be Listed

Oct 27, 2010

I made a web form on a development website of mine (we'll call it dev.somewhere.com) and tried to publish it out to the web (we'll call it [URL]) in a subfolder. I named it default.aspx like I was supposed to and it worked flawlessly on the dev site. When I published it out the web, I wound up getting the following error when trying to get to the subfolder: [URL] Directory Listing Denied

This Virtual Directory does not allow contents to be listed. Confused and flustered, I tried to go to [URL], but I wound up with some error that won't tell me the problem. Instead it tells me to change the my web.config to read <customErrors mode="Off"/>.

View 1 Replies

Why Necessary To Create Virtual Directory In IIS When Website Content Is Placed In IIS Root Directory

Feb 13, 2010

As virutal directory points to physical path of the application, so if the IIS root directory is C:inetpubwwwroot and the application is stored at D:websites, than we need to create a virtual directory but if the application content is placed at C:inetpubwwwroot, then why still need to create virtual directory.

View 3 Replies

C# - Get Name Of Virtual Directory?

Jan 30, 2010

I'm using Request.ApplicationPath to learn the name of the Virtual Directory in which I'm running. Is there a more reliable way?

View 2 Replies

Invoking WebMethods With XmlHttpRequest And Pure JavaScript?

Jun 22, 2010

I have what should be a relatively simple task that's frankly got me stumped. I've researched it until my brain is fried, and now I'm puntingHere's the scenario:I have an ASPX page (Q2.aspx) that is decorated with the WebService,WebServiceBinding, and ScriptService attributes. That page contains a method, GetAllContacts, that is decorated with the WebMethodattribute and returns a string containing JSON data. (For what it's worth, the pageitself contains no other controls or functionality.)I have an HTML page that contains JavaScript which uses the XmlHttpRequestobject to invoke the GetAllContacts WebMethod on the ASPX page and transformthe JSON data into an HTML table. I have verified that my Web.Config file contains the appropriate protocol handlersfor HttpGet and HttpPut in the WebServices section under System.Web.webServices.
I have verified that my Web.Config file contains the ScriptModule entry under theSystem.webServer.modules section, and that it matches the appropriate documentation.

However, when I view the HTML page in a browser, the following occur:The web request goes through, but the results are for the unprocessed HTML from the ASPX page.The GetAllContacts method is never invoked, as evidenced by setting a breakpoint in its code.The code to invoke the Web service, however, is invoked, and the JavaScript callbackfunction that is invoked upon request completion is properly invoked.

It appears that the JavaScript code is largely set up correctly, but for some reason that is completely escaping me at this point, the HTML page will simply not execute the WebMethod on the ASPX page, and simply returns the page as though it were a plain HTML GET request. Clearly, an HTML document can't be evaluated by JavaScript's eval function, which brings me to my problem. (Also note that the JSON data appears nowhere in the HTML that's returned.)I am, frankly, baffled. I've looked at dozens of Microsoft articles, StackOverflow posts, CodeProject articles, and who knows what else. My code looks like it's okay. But I know better. I'm missing something simple, stupid, and obvious. I just need someone to point it out to me.Below you'll find the ASPX page code and the HTML code, in the hope that they'll shed some light.ASPX Code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Q2.aspx.cs" Inherits="Satuit.Q2" enablesessionstate="False" %>
<html>
<body>

[code]...

View 1 Replies

Jquery - Invoking CustomValidator Validation From JavaScript?

Feb 18, 2011

I have the following setup, where I am custom validating a textbox. It works fine as long as I am manually typing in the textbox and changing the text and focusing out of the textbox.

[Code]....

when I try to invoke validation change event from javascript (using JQuery 1.4.2)

function copyCity() {
$('#<%= tbpCity.ClientID%>').value = "Some City";
$('#<%= tbpCity.ClientID%>').trigger("change");
}

the custom validation is not being invoked.

How can I inovke customvalidator to do validation?

note: I have verified this works on FireFox but not on IE. how to fire change event in IE.

View 1 Replies

C# - IIS 5.1 Not Resolving Virtual Directory?

Oct 13, 2010

I set up a Virtual Directory called 'Site'. I browse to [URL].In the source file, the relative paths are coded as '/Page1.aspx', for example, and it has worked in the past.I'm using Win XP Pro SP3 and IIS 5.1. Any ideas on what might be causing this behavior?

View 3 Replies

AJAX :: Invoking A Cs Method For An Update Panel Using Javascript?

Aug 11, 2010

I got XYZ page which got few divs inside of himin 1 of the divs there in an updatepaneland in another there are buttons which being inserted into the page using javascriptWhat I want to do is once a button is clicked, it would invoke a method using javascript in the server which would update the updatepanel

View 2 Replies

Go About Reading And Writing To Virtual Directory In 7?

Feb 10, 2010

How do you go about reading and writing to a virtual directory in iis 7?

View 2 Replies

A Virtual Directory Not Being Configured As An Application In IIS

Jan 13, 2010

I've below error message:

***********************************

Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:PdfViewerPdfTestSiteWeb.Config 28

***********************************
When I double click the error it goes to Web.Config file to tag:

<authentication
mode="Windows"/>

The application name in IIS is PdfViewer

View 2 Replies

Virtual Directory In IIS To Physical Path

Mar 1, 2010

My basic question is, can a virtual directory in IIS point to a physical path that's not on the local machine? For instance, right now I have a virtual path /NaturalGasReport/NYMEX which points to physical path C:Program Files (x86)NymexSettleNATGAS_REPORTNYMEX, but I want it to point to a physical path on a difference PC on the same network. Is this possible? (I know I can just try it out so I apologize for asking but I thought it would be best to get an explanation along with "yes" or "no"). If you want more detail, this is what I need to do. To make a long story short, because of a vendor product we are using that won't run on a 64-bit operating system, I have to run a program called Generate_NGReportData.vbs (it's a vbscript program) on a PC I will call 28. It uses a vendor product which produces jpg files which are graphs of the Natural Gas market. The machine where I wish it could run is called RTEST01 but this machine runs a 64-bit OS and the components won't work there. RTEST01 has the databases. So, I created a datasource on 28 which points to RTEST01's database. The vbs program will read the data, generate the reports, and write one row to a database table on RTEST01. RTEST01 has to run the complimentary program which sends these reports (via email). 28 is not an email server so it can't email the reports. So on RTEST01 I will run Send_NaturalGasReport.vbs. This program creates an email body of html. The html references [URL]NaturalGasReport/NYMEX/" & Day(nymex_update_dt) & ".jpg which is a virtual directory pointing to C:Program Files (x86)NymexSettleNATGAS_REPORTNYMEX. I need it to point to the folder and files on 28.So if my initial question has a simple yes answer then I am all set. If not, examine my architecture and propose an alternative solution.

View 10 Replies

Configuration :: 3.5 Deployment Without Virtual Directory?

Nov 2, 2010

First of all, I am trying to deploy a web application, without virtual directory. Yes...I have no other option but to try this due to some non-tehnical constraints.

Now, I have developed an ASP.NET 3.5 Web application, which works fine on my local ASP.NET Development Web Server. Then, I published the application to the actual webserver using the VS2008 Publish... option. When I got some error messages related to web.config, I removed the corresponding items from the web.config.

When I can access the page but the code inside the page doesn't really work. When I open the Default.aspx, which is directly under the website, I keep on getting this error:

Compiler Error Message: CS0246: The type or namespace name 'DynamicLoadControl' could not be found (are you missing a using directive or an assembly reference?)

This DynamicLoadControl is a class that I have developed and is present in App_CodeDynamicLoadControl.cs file (in the same namespace).

I have searched a lot and tried everything except creating a virtual directory. First of all, is it possible to have asp.net 3.5 website without virtual directory.

View 3 Replies

Installation :: While Creating Virtual Directory In IIs?

Jan 12, 2010

While creating virtual directory in IIS i am gettin "Failed to Access IIS metabase" problem can anybody help me regarding this issue

View 2 Replies

Configuration :: Creating The Virtual Directory?

Jan 12, 2011

m new to .net framework 4 and iis 7.I created a webapplication in VS2010 with C#.I created the virtual directory for that web application in my IIS (IIS 7).when i tried to open the page by using virtual directory, it is displaying the following problem.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.Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error:

[Code]....

Source File: E: estweb.config Line: 12 Show Additional Configuration Errors:

View 3 Replies

How To Create A New Virtual Directory On The IIS Pointing To Say C

Apr 29, 2010

Assuming here that I have full control over the server.I'm looking for a sample code that would help me understand how to create a new virtual directory on the IIS pointing to say C:

View 4 Replies

Configuration :: How To Create Virtual Directory In IIS

Jun 3, 2010

I'm new to IIS, I just want to create a virtual directory in IIS. I'm using WINDOWS7.When I Browse my Default file it throws the folling Error,Error SummaryHTTP Error 500.19 - Internal Server ErrorThe requested page cannot be accessed because the related configuration data for the page is invalid.

View 8 Replies

WebMatrix :: Virtual Directory In IIS Express?

Aug 5, 2010

Anybody know how to setup a virtual directory in IIS Express for things like Shared Resources? I can't figure out where to set it up in Web Matrix?

View 5 Replies

How To Access A Virtual Directory In IIS From CodeBehind

Dec 12, 2010

im a little bit angry, because i realy don't know how i can access a virtual directory a created in the IIS.

For example i created virtual directory called "Images" in the IIS under my default website. The "Images" folder is connected with my physical harddrive "D:Bilder".

Now how do i access this folder from code behind? I really tried everything but i can't load a image from this virtual directory :

View 5 Replies

C# Virtual Directory For Common Markup?

Feb 2, 2010

I have a few applications that need to share a common set of markup.

Scenario: I might have www.site1.com, www.site2.com, and www.site3.com. On all sites, /care/contact-us.aspx and /care/faqs.aspx will be exactly the same, but every other page will be totally different.

Issue: I'm attempting to not duplicate the .aspx files for each of these sites and would like to have a /care virtual directory that would include contact-us.aspx and faqs.aspx that each of these sites would use. I have seen this post from Scott Gu, but I'm looking for any other solutions/ideas.

Question 1: What would be the best way to set this up to share the /care directory?

Question 2: Any about also sharing the code behind.

Background, if you care: In a legacy application (asp classic/vbscript), we have the ability to use a /common virtual directory for sites to share common markup and code (since they're all mixed together in .asp files).

View 3 Replies

How To Rewrite To A Virtual Directory With A Different Application

May 4, 2010

I have a CMS application that manages multiple websites, today whenever i change the codebehind of one of these websites - i have to rebuild the dll for all websites, deploy it - this disconnects all current sessions and is really bad.

The iis is configured to listen to all domain requests, if the request is to one of the websites' domain , the application rewrites it, or example, if someone requests for http://www.example.com, and example.com is configured in the application to be website 12, it is rewritten to http://www.example.com/websites/12/default.aspx.

This is done for all websites.

We want to seperate the dlls of the websites from each other, and from the main CMS, we have a virtual directory to each websites, but when trying to rewrite to it, we discover that IIS support this (we get an "Could not load type '_12._Default'". error).

How can we perform this rewrite so it does rewrite to virtual directories, or if anyone has any other solution for the initial dll seperation problem.

View 2 Replies

How To Create A Virtual Directory Under A Website

Feb 8, 2011

I was running it directly from Visual studio which resulted in this error :) I can clearly see the images when I run it directly from IIS!

I've created a website under IIS and have successfuly pointed it to my project. The path to my project under IIS is:

[URL]

I, then created a virtual directory under website cartoon named cartoon_images but it creates it under localhost:36011/cartoon_images/ instead of localhost:36011/cartoon/cartoon_images/

As you can see, virtual directory is under the website "cartoon" but I can't access it as cartoon/cartoon_images/

I'll need to give links to this virtual folder but I can't do it in this case if I'm not mistaken.

View 1 Replies

Can't Get FCKEditor To Work In A Virtual Directory

Mar 12, 2010

I have a WebForm that contains the following definition for the FCKeditor:

<FCKeditorV2:FCKeditor ID="txtBody" runat="server"
BasePath="/fckeditor/"
Height="480px"
ToolbarSet="WebCal1"
>
</FCKeditorV2:FCKeditor>

This works fine in my VS2008-based web application. However, when I deploy it to a Virtual Directory in IIS, it looks for the FCKEditor files (e.g. javascript, stylesheets, etc...) in the /fckeditor folder, not in the /MyVirtualDir/fkceditor.

I've tried changing the BasePath to ~/fckeditor/, but then it won't work on my dev machine.

What is the right way to go, so that the FCKEditor maps onto the right directory. In my project the fckeditor directory is right off the root.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved