[英]how to pass a value of a control from one page to another using ajax in asp.net
I am trying to pass a value of a control(For example a textbox) from one page to another using ajax in asp.net with c#. 我试图使用c#在asp.net中使用ajax将控件(例如文本框)的值从一页传递到另一页。
any suggestions 有什么建议么
<input type="text" id="txt">
<input type="Submit" id="btn">
<script>
$(document).ready(function()({
$("#btn").click(function() {
Var textData = $("#txt").val();
$.ajax({
url:"Home/Index/" //In case of MVC.
type:'get'
data:{data:textData}
success: function() {
Your code..........
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.