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