ASP.NET / VB.NET:引用文本框值而不回发?
我在 iFrame 中有一个子 aspx 页面。有一些文本框,在页面加载事件中填充。
还有一个 LinkButton,用户在完成字段编辑后可以单击该按钮。有一些 javascript 函数和其他事情正在发生,所以完整的回发(即:asp 按钮)是不可能的。
问题是,单击链接按钮后我需要引用文本框新值(用户更改)。
有什么办法可以做到这一点吗?
谢谢,
Jason
编辑:
在进一步使用界面后,我意识到单击 LinkButton 后就会触发 Page_Load 事件。当然,这是数据最初加载的地方,因此用户所做的任何更改都会立即被覆盖。当前的攻击计划是创建一个 IsLoaded cookie 值并在执行上述代码之前检查是否为 true。如果有人有更好的主意,请告诉我!
谢谢,
杰森
I have a child aspx page in an iFrame. There are a few textboxes, which are populated in the page load event.
There is also a LinkButton which the user clicks when s/he is finished editing the fields. There are some javascript functions and other things going on, so a full postback (ie: asp button) is out of the question.
Problem is, I need to reference the textboxes NEW values (user changes) after the linkbutton is clicked.
Is there any way to do this?
Thanks,
Jason
EDIT:
After playing with the interface a bit further, I realized the Page_Load event was firing as soon as the LinkButton was clicked. Of course this is where the data is initially loaded, so any changes the user made is immediately written over. Current plan of attack is to create an IsLoaded cookie value and check if true before the mentioned code executes. If anybody has a better idea, please let me know!
Thanks,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 jQuery 在单击按钮时获取文本框值。
然后,您可以通过使用 jQuery AJAX 调用此文本框值传递给服务器端方法。请参阅下面的链接。
http:// /weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx
You can use jQuery to grab the textbox value on click of the button.
Then you may pass this textbox value to a server side method by calling it using jQuery AJAX. See the link below .
http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx
您想从父级或打开该 Web 表单的 iframe 中访问新的文本框值吗?
You want to access the new textbox values from the parent or from within iframe which has that webform opened?