I'm having a bit of an issue in my ASP.Net application moving focus from a textbox in one user control to a text box in the next user control on the page after postback. I've searched high and low over the last several days to find a solution but, for whatever reason, have been unable to do so.
I have a page that has user controls loaded dynamically to allow a user to enter data.The number and type of user controls loaded to the page is determined at run time based on a database query.It is possible than many controls of the same type can be loaded. Each user control has its own update panel. Within the update panel of each control is a regular asp panel. Inside of the regular panel there are at least 2 server controls (any other controls that may exist in the user control are not affected by this issue) - a text box and a button.The defaultbutton property of the regular panel is set to the ID of the button within the user control. The desired behavior is to allow the user to enter data into the textbox on one user control hit enter to save the data on that user control the application will set focus to the textbox of the next user control on the page after the data from the "current" user control has been saved. Other considerations;
The application uses master pages. We make extensive use of ajax and the ajaxtoolkit in the application. I am using Visual Studio 2010 and .Net 4 The issue - when first entering the page, one can enter data into the first textbox and press the enter key. Data from "current" user control is correctly saved and focus is correctly moved to the next user control on the page.
Data can be entered into the textbox of "new" user control and when the enter key is pressed, the data is correctly save. The focus appears to move correctly to the next user control on the page.Data cannot be entered into the textbox of the control. Pressing the enter key will not save the data (because none was entered) but the focus will move to the textbox of the next user control on the page.
Data can be entered into the textbox of the user control. When the enter key is pressed, the data is correctly saved and the focus appears to move correctly to the textbox of the next control on the pageBasically, steps 3 and 4 are repeated until the end of the user controls on the page, alternating between being able to enter data and not. Other items of note When one is able to enter data into the textbox of a user control, one can correctly tab through the textboxes of each user control until the end of the page When one is not able to enter data into the textbox of a user control, pressing the tab key will take the focus to the address bar of the browser.
I created a much simplified example of the scenario described above and was able to consistently reproduce the "bad" focus behavior. All of the ajax toolkit controls and code where stripped out of the sample to rule the toolkit out as a cause. The behavior still occurs without the toolkit.
I am including the code for default.aspx and WebUserControl1.ascx.
I have a user control, that has an update panel and update progress control in it.
I use this user control in more than 1 location on the same page.... problem is, when ucA posts back, I see the update progress control for both ucA and ucB. I assume this is because it is a user control and the update panel and progress are named the same?
Either way - how do I make it so that the update progress only displays for the proper user control?
I've exempted the irrelevant bits of code. Essentially, I am trying to change the URL of an image control inside of an update panel inside of a custom user control from a function called inside an update panel from my main page. Using UpdatePanel.Update() isn't working: I end up waiting for the next full page POST to occur before all the updates I make to CustomControl from buttons within the main page's update panel are visible. I verified that Update() was being called via the debugger: there are no issues in that department.
Here, you can see Custom Control and the Button declared. The button is in an update panel to avoid giving a full POST and causing the whole page to reload.
This control stores images within their own seperate update panels because rerendering the images is very slow (it requires processing arrays of millions of datapoints) and the user only ever needs to modify one image at a time. I'm using Image1 as an example.
I have an AJAX Modal Popup panel that contains a RadioButtonList, 2 labels and 2 DropDowns. I want to update the Labels and DropDowns when a radio button is selected. My attempt at this posts back which causes the ajax popup to disappear.
aspx called on image click: <asp:Panel ID="pnlModalContainer" runat="server"> <asp:RadioButtonList ID="rblTest" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblTest_SelectedIndexChanged"> [code]...
I have a form, with an update panel and the EnablePartialRendering set to true on the page. Here's my problem, the page size with every AsyncPostBack gets larger, even if my code makes no changes to the markup. It also, never stops... it just keeps growing about 3-4K with every AsyncPostBack. If EnablePartialRendering is set to false, full postbacks do not cause the page size to grow like that. It's like it's sending resources and then never getting rid of them out of the page even though they're not being used because an updated copy has come down.
1.) Is it supposed to work like that?
2.) If it's not, what can I do to not have 4K added to the page size everytime an AsyncPostBack occurs (not again, full PostBacks do not have that same behavior).
3.) This behavior happens whether I compress the ViewState or not (I am using ViewState compression). However, the ViewState size is NOT growing... it's the size of the content in the page that is (I'm monitoring the ViewState size/the Page Size closely).
I have an UpdateprogressControl on my page and an Update panel. The UpdateProgress is not associated with the UpdatePanel as I want the update progress to show when the user clicks on any control in or outside the Updatepanel content. However the update progress only shows when a control is fired from within the update panel and not on any control outside the update panel.
I have used the update panel for avoiding reload page.but because of update pane radiobutton event not fired properly. I want to show Popup widow on link click.This popup contain the gridview.When I choose radiobutton which belogs to that gridview popup will be closed and as per grid row selection data will be display in text box which are belogs to form rather then popup.Now because of update panel I can avoid reloading page but above functionality doesnot work.
I have written a Crystal reports web application, that prompts ths user for parameters and then apply them and exports the report to a folder as .rpt and then display the report.
I prompt the parameters on one screen and then display the report on another page. I have the AJAX update panel and update progress controls in the parameter page. When the user enters the parameters and click on ok, I export the report and then loads the report to a session report document and transfer the user to the second page where the report is displayed. I use the following code to do transfer to the seconds page.
I have excluded the report load and parameter assign code here.
In the second page I have the following:
rptViewer.reportsource = Session("rpt")
My problem is this works one time and then stops working the second. What I found out was it comes to the statement:
But it does not even load the show.aspx page. It stays on the parameter page. There are no errors displayed. I could not see any errors when I debug the application also. And out of the blue it works sometimes. And if I remove the update panel and progress control, my report works all the time.
I have a web application project, in which i have 2 projects one is for my UI and other for dealing with database. In UI i have a page on which i have used update panel and script manager, the usual procedure, but surprisingly update panel is not working my page is getting refreshed.
Got some small(Basic) doubt on update panel. Using Update Panel, Is it possible to stop updating a part of Page ?
I want it exactly in reverse way (It is very difficult for me to place Update panel for the entire page excluding the small part).
I have a script manager and 3 update panels on my page. I am not very familiar with AJAX but I would think anything in the contentTemplate would not cause a postback and page reload, but they all do, here is the outline of the SM and UpPanels
It works fine in Firefox but in IE 7 fails doing the postback sometimes. Is it just a problem with my browser? The partial postback inside the update panel works great in both browsers, but when I hit the button outside the panel, the complete postback doesn;t work in IE....
In a page I have multiple update panels that has timer associated with them to refresh the grids. Issue is that when asynchronous request (update panel) is in progress page do not respond. If use try to click some other link to move he even can not do that until asynchronous request is completed. Is it not possible that user may able to click some other button if he want while update is in process ?