autopostback

Set focus back to the proper textbox after autopostback function (Page.SetFocus doesn't solve the issue)

有些话、适合烂在心里 提交于 2021-02-10 10:43:57
问题 Now, this MAY look a duplicate, but it's not. Every solution on the internet shows you how to get focus on the textbox that fired the event. But what if the user presses tab? The textbox that should have focus is the next one. So we do a workaround and focus on the textbox that have TabIndex higher than the one that fired the event. But then what if the user presses Shift+tab? Even worse: what if the user clicks on another random textbox? This is the issue. I don't think a code is required

Set focus back to the proper textbox after autopostback function (Page.SetFocus doesn't solve the issue)

£可爱£侵袭症+ 提交于 2021-02-10 10:43:31
问题 Now, this MAY look a duplicate, but it's not. Every solution on the internet shows you how to get focus on the textbox that fired the event. But what if the user presses tab? The textbox that should have focus is the next one. So we do a workaround and focus on the textbox that have TabIndex higher than the one that fired the event. But then what if the user presses Shift+tab? Even worse: what if the user clicks on another random textbox? This is the issue. I don't think a code is required

ASP.NET AutoPostBack and then Back Button weird occurrence

核能气质少年 提交于 2020-01-23 19:24:32
问题 To keep this simple, I have a dropdownlist and a button in an ASP.NET form. The dropdownlist has an autopostback function that calls DropDownList1_SelectedIndexChanged and the page is redirected somewhere (for this example www.google.com) and the button has an onclick that goes to Button1_Click1 and the page gets redirected to www.yahoo.com. The Problem: If I click the button, I go to Yahoo, which is what you'd expect. If I click back button in my browser and select the dropdownlist I go to

C# How to set the autopostback property when using asp.net mvc?

依然范特西╮ 提交于 2020-01-21 02:36:10
问题 I am using asp.net MVC framework. On my page i have a dropdwonbox and when an option is clicked i want to go to another page. But i can't find how/where to set the autopostback property to true. This is the code i'm using: Aspx: <%= Html.DropDownList("qchap", new SelectList( (IEnumerable)ViewData["qchap"], "Id", "Title" )) %> Controller: public ActionResult Index(int id) { Chapter c = new Chapter(); ViewData["qchap"] = c.GetAllChaptersByManual(id); return View(); } What do i have to do to use

Problem in using AutoPostback in asp.net c#

守給你的承諾、 提交于 2020-01-05 07:24:15
问题 i have two text box controls with calender extender and a dropdownlist as follows. <asp:TextBox ID="txtStartDate" runat="server" ReadOnly="True"></asp:TextBox> <asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtStartDate" runat="server" Format="yyyy-MM-dd" /> <asp:TextBox ID="txtEndDate" runat="server" ReadOnly="True" ontextchanged="txtEndDate_TextChanged"> </asp:TextBox> <asp:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" Enabled="True" TargetControlID=

AutoPostback with TextBox loses focus

烂漫一生 提交于 2020-01-03 08:49:15
问题 A TextBox is set to AutoPostback as changing the value should cause a number of (display-only) fields to be recalculated and displayed. That works fine. However, when the field is tabbed out of, the focus briefly moves on to the next field, then disappears when the page is redrawn so there is no focus anywhere. I want the focus to be on the new field, not the textbox I've just changed. Is there a way to work out which field had the focus and force it to have it again when the page is redrawn?

Have to click button twice in asp.net (after autopostback textbox)

淺唱寂寞╮ 提交于 2020-01-03 07:21:08
问题 On a page I have: <asp:TextBox runat="server" ID="EmailTextBox" AutoPostBack="true" OnTextChanged="EmailTextBox_Changed" /> <asp:Button runat="server" ID="SearchButton" OnClick="AddButton_Click" Text="add" /> In EmailTextBox_Changed, it counts up how many emails can be found, before running the search. The problem is, when you type something in EmailTextBox, and click on the button, you have to click twice to get the actual results up. This is because the first click is doing the

ASP.NET C#, dynamic drop down in repeater causing full post back

旧时模样 提交于 2020-01-03 02:26:12
问题 I have a page that contains a Repeater, which contains server control elements, within an UpdatePanel and while all other controls behave normally, the Drop Down control causes a full postback every time. <asp:Repeater ID="rpt" runat="server"> <ItemTemplate> <asp:SomeWorkingControl ID="swc" runat="server" /> <asp:DropDownList ID="ddl" runat="server" OnSelectedIndexChanged="ddl_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Text="0" Value="0" /> <asp:ListItem Text="1" Value="1" /> <

Causing auto post back by typing text into TextBox without pressing enter or tab

回眸只為那壹抹淺笑 提交于 2019-12-25 10:00:55
问题 I want my asp.net TextBox to cause auto postback and activate a sever side event upon typing text into the TextBox without pressing enter or tab, similar to WinForms. Is this possible? If so is it possible to have this happen only after typing a certain number of characters such as three or four? Thank you. 回答1: You cannot compare Windows-Applications and WebApplications. To post back to server when the user enters a char means that all HTML must be recreated from ASP.NET and send back to the

Enter key causes the unnecessary post-back

坚强是说给别人听的谎言 提交于 2019-12-25 04:37:19
问题 I have a web-application form in vb.net. When I click on a radio button, a postback is run on the server. If I press enter at the same time it causes another postback to the server. How do I prevent that second postback? <td class="tdClassic" id="tdCT"> <asp:RadioButton ID="rbSingle" runat="server" Text="Singl" AutoPostBack="true" GroupName="grpT" /> <asp:RadioButton ID="rbMultiple" runat="server" Text="Multiple" AutoPostBack="true" GroupName="grpTrainer" /> </td> 回答1: If you are using jQuery