从html页面调用aspx页面并将其放入div标签 [英] calling aspx page from html page and placing it into div tag

查看:178
本文介绍了从html页面调用aspx页面并将其放入div标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我能够将aspx页面内容放在demo.html的div标签中,但问题是当我按下aspx按钮时它会回复而不是进入同一页面( demo.html)它回发到aspx页面(innerpage.aspx) 



我想要的是之后的回发它不应该调用aspx页面。即使在从aspx文件后面的代码执行代码之后它也应该保持在同一个div中(在demo.html中)。

解决方案

在div内你不能获取页面内容而是使用iframe



 <   iframe     src   =  yourpage.aspx    width   =  200px    height   =  400  >  
< p > 您的浏览器不支持iframe。< / p >
< / iframe > ;


如果你坚定地在div中使用它你可以做什么在标题和ajax成功时对该aspx页面进行ajax调用在div uisng jquery之后使用该aspx页面的内容



函数LoadPage(){


< blockquote> .get(' http://a_site.com/yourpage.aspx',功能(数据) ){


I have able to place aspx page contents in div tag of demo.html, but problem is  when i press aspx button it get post back and instead of getting in same page(demo.html) it postback to aspx page(innerpage.aspx)


what i want is that after postback it should not call aspx page. it should maintain in the same div(in demo.html) even after executing code from code behind file of aspx.

解决方案

Inside div you cant get the page content instead use Iframe

<iframe src="yourpage.aspx" width="200px" height="400">
  <p>Your browser does not support iframes.</p>
</iframe>


what you can do if you firm to use it in div make an ajax call for that aspx page in header and on success of ajax put content of that aspx page using after the div uisng jquery

function LoadPage(){


.get('http://a_site.com/yourpage.aspx', function(data) {


这篇关于从html页面调用aspx页面并将其放入div标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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