如何在回发后按钮点击.ascx页面,将输入值保持在文本框中 [英] How maintain the enter value into the textbox after postback onbutton click on .ascx page

查看:60
本文介绍了如何在回发后按钮点击.ascx页面,将输入值保持在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文本框中输入值。按钮ID是btnDone我想将文本框值存储到字符串变量str中。但是当我点击按钮时,文本框值因为回发而消失。当我点击按钮时,请帮助我如何将文本框值输入字符串。



我的按钮按钮和文本框都在GridviewControl中

I am entering the value into the text box. on button ID is btnDone I want to store textbox value into the string variable str. but when i click on button then textbox value is vanished as because of postback. please help me to how to get the textbox value into the string when I click on button.

My button button and textbox both are in GridviewControl

推荐答案

请参阅我最近的解决方案: http://www.codeproject.com/Answers/1094229/How-to-maintain-same-textbox-value-after-postback#answer1 [ ^ ]。



请不要重新发布;由于显而易见的原因,这被视为滥用。



-SA
Please see my recent solution: http://www.codeproject.com/Answers/1094229/How-to-maintain-same-textbox-value-after-postback#answer1[^].

Please don't re-post; this is considered as abuse, by obvious reasons.

—SA


而不是onlick event,为Gridview按钮尝试OnRowCommand事件。
Rather than taking onlick event, Try OnRowCommand event for button of Gridview.


这篇关于如何在回发后按钮点击.ascx页面,将输入值保持在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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