npl77
asked on
TextBox Causing A Postback In Dynamic .ascx Control
I have a ascx control that contains an asp:Textbox control. I add the ascx control to a web form dynamically. If I click inside this textbox (that is read only and autopostback is false) and then click a key on the keyboard it causes a postback. If the textbox is in a web form and now anscx control obviously it does not cause a postback and everything works correctly. Is there a way to stop this postback from happening? What about using html textboxes instead will that fix it? I need the textbox to do 2 things:
1. Populate with data from the db on the loading of the control (uncertain if this is even possible with an html textbox)
2. Get access to the textbox through code if not in read only mode. Ive tried to access an html textbox in code behind and I am unsure how. The Id of an html textbox is not accessible from code behind.
1. Populate with data from the db on the loading of the control (uncertain if this is even possible with an html textbox)
2. Get access to the textbox through code if not in read only mode. Ive tried to access an html textbox in code behind and I am unsure how. The Id of an html textbox is not accessible from code behind.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Whats happening is when I click the "Backspace" key after giving one of these textboxes focus. The code is automatically going back to the previous ascx control that was loded into the placeholder. Does that make any type sense?
No, that is not a normal problem. You are going to have to show me something that would attempt to explain the problem in more detail...
ASKER