Question quick version:
How do I change the visibility of an ASP control (eg. a button) from code behind without to add it in the Telerik Ajax Manager?
Question long version:
I am very frustrated. I am strugling with this problem for two days now, and couldnt achieve any success so far.
Some time ago, I have written a very stable chat service in VS 2008, and the client-side was done using traditional Ajax coding (JS).
Well, my boss is a technology freak and told me that I should get rid of my conventional code and use all these cool Telerik Ajax components. For the mostly tasks such as checking queue, enter queue, etc, it goes ok, but my real nightmare started in the main chat page.
Ok, let me try to explain what is going on.
I have the chat.aspx where there are all the traditional VS components (buttons, textfields, timers, etc) and also the Telerik Ajax Manager and the Rad Script Manager. Running behind it, I have my chat.aspx.cs code (c-sharp).
In the chat.aspx I have four main components:
txtChat -> big textfield where all messages show up
txtMessage -> small textfield where user type in his message
btnSend -> button to be clicked and send typed message
tmrUpdateChat -> a timer that bangs server each 2 seconds to update txtChat
In the Telerik Ajax Manager, I configured it this way:
who initiate Ajax request: tmrUpdateChat
who is updated: txtChat
Fine, it is working nicely!
The case is that when the chat operator (in the other side) ends the conversation, a message is shown in the client txtChat warning that the chat session was closed. In addition, the send button (btnSend) and the typing textfield (txtMessage) should be turned invisible with:
For any unknown reason, the above commands are being ignored and nothing happens (my components just keep there, visible).
I figured out that if I change my Ajax Manager settings this way:
who initiate Ajax request: tmrUpdateChat
who is updated: txtChat, btnSend, txtMessage
Then the CS commands DO work and make my components invisible. The sad part of the story is that in this case, a new problem appear - every time the timer updates the chat, the txtMessage textfield lose focus, what is very annoying for whose is trying to type a message.
I dont know if I could make myself clear, as this issue is a bit hard to explain. It is driving me crazy.
What makes me more frustrated is that I had everything working fine with traditional JS, and using this technology supposed to be better, but the fact is that I am feeling as I would just spending a lot of time for nothing.
:(
Any help apreciated.
How do I change the visibility of an ASP control (eg. a button) from code behind without to add it in the Telerik Ajax Manager?
Question long version:
I am very frustrated. I am strugling with this problem for two days now, and couldnt achieve any success so far.
Some time ago, I have written a very stable chat service in VS 2008, and the client-side was done using traditional Ajax coding (JS).
Well, my boss is a technology freak and told me that I should get rid of my conventional code and use all these cool Telerik Ajax components. For the mostly tasks such as checking queue, enter queue, etc, it goes ok, but my real nightmare started in the main chat page.
Ok, let me try to explain what is going on.
I have the chat.aspx where there are all the traditional VS components (buttons, textfields, timers, etc) and also the Telerik Ajax Manager and the Rad Script Manager. Running behind it, I have my chat.aspx.cs code (c-sharp).
In the chat.aspx I have four main components:
txtChat -> big textfield where all messages show up
txtMessage -> small textfield where user type in his message
btnSend -> button to be clicked and send typed message
tmrUpdateChat -> a timer that bangs server each 2 seconds to update txtChat
In the Telerik Ajax Manager, I configured it this way:
who initiate Ajax request: tmrUpdateChat
who is updated: txtChat
Fine, it is working nicely!
The case is that when the chat operator (in the other side) ends the conversation, a message is shown in the client txtChat warning that the chat session was closed. In addition, the send button (btnSend) and the typing textfield (txtMessage) should be turned invisible with:
txtMessage.Visible = false; btnSend.Visible = false; |
For any unknown reason, the above commands are being ignored and nothing happens (my components just keep there, visible).
I figured out that if I change my Ajax Manager settings this way:
who initiate Ajax request: tmrUpdateChat
who is updated: txtChat, btnSend, txtMessage
Then the CS commands DO work and make my components invisible. The sad part of the story is that in this case, a new problem appear - every time the timer updates the chat, the txtMessage textfield lose focus, what is very annoying for whose is trying to type a message.
I dont know if I could make myself clear, as this issue is a bit hard to explain. It is driving me crazy.
What makes me more frustrated is that I had everything working fine with traditional JS, and using this technology supposed to be better, but the fact is that I am feeling as I would just spending a lot of time for nothing.
:(
Any help apreciated.