如何从mvc视图页面调用aspx页面 [英] how to call a aspx page from mvc view page

查看:342
本文介绍了如何从mvc视图页面调用aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从div中的mvc视图页面调用aspx页面..



请帮助

解决方案

< blockquote>我不完全确定为什么你需要在mvc / razor视图中使用.aspx页面,但是我认为最好的方法就是使用jquery来处理它。



 <   html  < span class =code-keyword>>  
< head >
< script src =' http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js' > < / script >
< script type = text / javascript >


(function(){
//而不是index.html,这里的.aspx文件的路径


('。div')。load('的index.html');
});
< / script >
< / head >

< body >
< div class = div style = 保证金:10px 15px 10px 15px; >

< / div >
< / body >
< / html >





使用.load可以将整个.aspx文件加载到mvc视图中的div中,或者你可以指定.aspx文件中的某个div / block特别加载。



 


how to call a aspx page from mvc view page in div..

please help

解决方案

Im not entirely sure why you would need to use a .aspx page in an mvc/razor view, but anywho the best way in my opinion to take care of this would be to handle it using jquery.

<html>
    <head>
        <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>
        <script type="text/javascript">


(function(){ //Instead of index.html, path to your .aspx file here


('.div').load('index.html'); }); </script> </head> <body> <div class="div" style="margin: 10px 15px 10px 15px;"> </div> </body> </html>



Using .load you can load the entire .aspx file into a div in your mvc view or you can specify a certain div/block from your .aspx file to load in particular like so.


这篇关于如何从mvc视图页面调用aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆