Forum  General Visual ...  Announce It! ( ...  TextBox.Text is empty in KeyPress Or KeyDown event on version 6.4
Previous Previous
 
Next Next
New Post 8/23/2011 1:19 AM
  alexul
1 posts
No Ranking


Re: TextBox.Text is empty in KeyPress Or KeyDown event on version 6.4 

Hello,

I am using the free 30 days trial of .NETHTML5 and I am really impressed about how easy it is to have stateful web applications. We have an application that relies heavily on ajax and jquery and all sort of update panels for partial rendering and that complicates things a lot. Your fraemwork would be a solution however I came up over the same situation regarding textboxes and text changed event. In our project we have a lot of textboxes matched with other controls that are enabled/disabled whether there is some text in the paired textbox.

I understand there already is a work in progress here. I hope a new realease which will contain the fix will be available soon because I think this is a big need. Until then I tried some workarounds, by using a timer:

 private void timer1_Tick(object sender, EventArgs e)
        {
            i++;
            button1.Enabled = string.IsNullOrEmpty(textBox1.Text) ? false : true;
            button1.Update();
            label1.Text = i.ToString();
            label1.Update();
        }

 The thing is that the label refreshes corectly, I can see the counter going from 1. But the button still doesn't refreshes until I move the focus from the textbox. I would be thankful for any idea.

Alex

 
New Post 8/23/2011 6:07 AM
  JamesC
634 posts
www.redcastle.co.uk
1st Level Poster




Re: TextBox.Text is empty in KeyPress Or KeyDown event on version 6.4 

Hi there,

the textboxes text property doesn't update until the texbox loses focus - hence your timer tick solution doesn't work

rather than subscribe to the keypress\down event (if ti was working) for a requirement such as yours I would have used the TextBox.LostFocus Event instead anyway, and just updated the buttons enabled property during those events.

Making the solution work using the keypress event would have meant a round trip to the server on each keypress using the lostfocus you are only making one round trip per textbox edit

Test using that LostFocus instead (you won't need the timer either) and see if that solution is better for you

cheers james

 
New Post 8/24/2011 2:40 PM
  palli
11824 posts
1st Level Poster




Re: TextBox.Text is empty in KeyPress Or KeyDown event on version 6.4 

Hi Alex,

Welcome to Visual WebGui

I am glad you like our framework, and I can also see that you are getting great help from the community as well.

Thanks go to James for his reply.

Please let us know if there is anything more we can help you on this subject.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  Announce It! ( ...  TextBox.Text is empty in KeyPress Or KeyDown event on version 6.4
CompanionKit Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS