![](/img/trans.png)
[英]How to transfer a lot of html content from one .aspx page to other .aspx, any way?
[英]Transfer of value from aspx page to HTML page
我有一個控制頁面,在該頁面上可以設置要控制的某些參數。 該頁面以aspx
格式顯示,當我單擊“提交”時,我希望該數據位於.htm
頁面的textbox
。 如在html中,我沒有C#文件,那么該怎么辦?
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<iframe src="http://10.112.90.131/index.htm" border="0" frameborder="0" height="600" width="800"></iframe>
</asp:Content>
我認為您應該使用aspx頁面而不是html,盡管您可以通過aspx將值通過查詢字符串轉換為html並通過JQuery / JavaScript解析查詢字符串。
假設下面是從aspx頁面打開HTML頁面的查詢字符串。
http://stackoverflow.com/ShowData.htm?firstname=jhon
現在,遠程html上的JQuery / JavaScript代碼將是:-
$(function () {
//Setting textbox value to jhon as per querystring
$("#SomeTextBoxID").val(getParameterByName("firstname"));
}
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.