我在我的本地机器上开发并运行。。。但是,当我尝试在dev机器上运行时,它总是要求输入用户名和密码。
它是否与打开的URL的凭据有关?(我可以在需要的时候打开它
else
语句被执行。当
if
执行下面的语句时,我总是遇到此错误。)
我需要保留像这样的东西吗
[AcceptVerbs(HttpVerbs.Post),Authorize]
控制器中的方法?
在JS页面中
$.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."); }
});
在控制器中。。。
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.
}
}