views:

145

answers:

1

Hi All, I am now to MVC F/W. I developed an application where i need to Open a new URL (WHich comes from other server)

I developed and it worked in my Local Machine ... But when i try to run on DEV Machine it alwsys asks userID and Password.

Is it anything related to Credientals of the URL Opened. (I am able to open it when else statement is executed. When the IF stmt below is executed i always encounter this error)

Do i need to keep anything like [AcceptVerbs(HttpVerbs.Post),Authorize] ? to the method in the controller ?

in JS Page

$.ajax(
{
    type: "Post",
    url: "/Rep.mvc/AddView",
    data: { AnnIDs: IDs,gsa: GAS, OpenedFrom: From },
    dataType:"script",
    success: function(result) {
        //alert(result);
        window.open(result, "Ann")//Open the returned URL in a window
    },

error: function(req, status, error) { alert("An error occurred while processing your request."); } });

IN Controller.. RepController.cs

public ActionResult AddView(string AnnIDs, string gsa, string OpenedFrom) { try { if (true) return JavaScript(blobDoc.remoteURL);//Here i always get error when i try to Open else
return new RedirectResult(blobDoc.remoteURL);//NO Error. } }

Any help Plz

A: 

This could be a proxy issue, are you using a proxy to connect to the WEB? On your local machine you might have your IP addr or localhost on the list of URLs not to use the proxy for.

If this is different on the other machine it might be looking for the users proxy password to try and find the URL on the Web.

Its more of a browser setup issue than anything you've done wrong, I know I come across this issue when initially attempting to access internal test sites that I haven't used before.

MadMurf