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
有什么建议么
1 个解决方案
#1
1
<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..........
}
});
});
#1
1
<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..........
}
});
});