在视图中打开 URL(MVC 3)

发布于 2024-12-05 13:52:30 字数 462 浏览 5 评论 0原文

您好,我的应用程序有问题,我正在使用带有 C# 和 VS 2010 的 MVC 3。

我有一个旧的桌面应用程序,其中在一种形式中我添加了一个控件 browser_Naviged 用于显示一个页面,用户可以在其中添加 yahoo 的凭据以供使用一个 API。

现在我的问题是我不太了解 MVC3 然后我不知道如何将一个 URL 打开到一个 div 中 我尝试使用 Ajax.ActionLink

public ActionResult GetAuthorizationLink()
{
   string s = "$('#divResultText').load('http:\\google.com')";
   return JavaScript(s);
}

我想评论一下,我将在弹出窗口中显示信息,然后我认为我无法在另一个弹出窗口中打开弹出窗口。

感谢您的帮助,以获得解决此问题的一些想法

Hi I have a problem with my Application I am using the MVC 3 with C# and VS 2010.

I have a old desktop application where in one form I added a control browser_Navigated for show one page where the user could add the credentials of yahoo for use one API.

Now my problem is that I don't know a lot of MVC3 then I am not sure how I can open one URL into a div
I try to use Ajax.ActionLink

public ActionResult GetAuthorizationLink()
{
   string s = "$('#divResultText').load('http:\\google.com')";
   return JavaScript(s);
}

I would like comment that where I will show the information is a pop up then I think that I can't open a popup inside another popup.

Thanks for any help, for obtain some idea for fix this problem

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

廻憶裏菂餘溫 2024-12-12 13:52:30

您可以使用 来实现这一点,特别是当您尝试加载某些外部域时:

<iframe id="result"></iframe>
<a href="#" id="load">Load data</a>

然后:

$(function() {
    $('#load').click(function() {
        $('#result').attr('src', 'http://www.google.com');
        return false;
    });
});

You could use an <iframe> to achieve that, especially if you are trying to load some external domain:

<iframe id="result"></iframe>
<a href="#" id="load">Load data</a>

and then:

$(function() {
    $('#load').click(function() {
        $('#result').attr('src', 'http://www.google.com');
        return false;
    });
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文