ASP.NET 2008 TextBox输入击键 [英] ASP.NET 2008 TextBox Enter Key Stroke

查看:59
本文介绍了ASP.NET 2008 TextBox输入击键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真棒,:笑:

我需要你的帮助.请帮我. ; P

我在TEXTBOX数据输入上遇到了关于ENTER KEY STROKE的非常有趣的问题.每次输入数据后,按ENTER KEY STROKE,都会清除所有TEXTBOX数据.

如何确保当用户按下ENTER键时,它不会删除所有的TEXTBOX数据.

以下是ENTER KEY STROKE似乎激活的两个事件:

Hi Awesome Good Guys, :laugh:

I need your help. Please Help me. ;P

I encountered a very interesting problem regarding ENTER KEY STROKE on TEXTBOX data entry. Each time the after data entry and press ENTER KEY STROKE, it clear all the TEXTBOX data.

How do I ensure that when ENTER KEY is pressed by user it will not removed all the TEXTBOX Data.

These are the two events that the ENTER KEY STROKE seems to activate:

Protected Sub Page_Load(ByVal sender As Object,
                      ByVal e As System.EventArgs) Handles Me.Load
   ''retrieve connection string from Web.config
    connstr = ConfigurationManager.ConnectionStrings("DataConnstr").ConnectionString

        If IsPostBack Then
            intPage = 1
            strCustID = Session("custid")
        End If
    End Sub

    Protected Sub BtnLoadGridView_Click(ByVal sender As Object, 
           ByVal e As System.EventArgs) Handles BtnLoadGridView.Click

        Dim intTotalPageCnt As Integer = 0
        GridView1.PageIndex = intPage - 1
        FLoadGridView()
        FCleartextBox()

        intTotalPageCnt = GridView1.PageCount
        Me.lblPage.Text = "Page : " & CType(intPage, String) & " of " & CType(intTotalPageCnt, String)

    End Sub






谢谢您的帮助.

祝你有美好的一天.
干杯.
Lennie






Thank you for your help.

Have a Good Day.
Cheers.
Lennie

推荐答案

好吧,那里有一个叫做FCleartextBox的方法,所以我想这就是问题所在.我敢打赌,您在文本框中启用了自动回发功能,因此请将其关闭,或者修复您的代码,以便在您不希望自动回发的情况下也不会清除该文本框.
Well, there''s a method there called FCleartextBox, so I guess that''s the issue. I am betting that you have autopostback turned on in the text box, so turn it off, or fix your code so that it doesn''t clear the textbox if you don''t want it to.


克里斯蒂安·格劳斯:laugh::laugh:

Yaaa ... Hoooo .......赞美主的帮助,并与我分享您的知识...... Hallelujah! :笑:

我已经尝试了AUTOPOSTBACK,它可以工作.我的DataEntry WEBFRM1.aspx现在运行良好.........您在共享信息方面非常出色且慷慨.很高兴在这个奇妙的论坛与您见面

以下是修改后的代码示例:
Hi Christian Graus :laugh: :laugh:

Yaaa...Hoooo..........Praise the Lord for your help and sharing your knowledge with me......Hallelujah ! :laugh:

I have tried out AUTOPOSTBACK and it works. My DataEntry WEBFRM1.aspx is now working very well.........You are awesome and generous in sharing information. I am so glad to meet you here at this WONDERFUL FORUM

Here are the sample amended coding:
<asp:textbox id=""txtCustAddr"" cssclass=""textbox"" width=""250px"" runat=""server"<br" mode="hold" xmlns:asp="#unknown" />                            EnableViewState="true" AutoPostBack="false"  >
  </asp:TextBox >







非常感谢您,愿耶和华为您祝福 :laugh:


祝您有美好的一天.
干杯,
列尼







THANK YOU VERY MUCH AND MAY THE LORD BLESS YOU :laugh:


HAVE A GOOD DAY.
Cheers,
Lennie


这篇关于ASP.NET 2008 TextBox输入击键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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