postback

Get SelectedValue at SelectedIndex in DropDownList?

别来无恙 提交于 2019-12-13 20:39:25
问题 Is this possible? I programatically change the selected index when a certain event is fired using this code: DropDownList.SelectedIndex = DropDownList.SelectedIndex + 1 Now I want to update a corresponding textbox with the text that is in the new SelectedIndex of the DropDownList via postback. What's the easiest way to do this? I know how I can do this in javascript.... I was just wondering if i could do this in the VB code behind. 回答1: TextBox.Text = DropDownList.SelectedValue; Read more

Calling multiple __doPostBack from JavaScript

我与影子孤独终老i 提交于 2019-12-13 20:32:48
问题 I've got multiple UpdatePanel's on a page and i'm updating 2 of them manually by calling __doPostBack. However the problem is the first call seems to be reset when the second call is made (it never updates the panel that i requested to update first). I've got these calls wrapped in setTimeout, but it does not seem to help. Any suggestions on how to make both calls work? 回答1: You could probably do this on the server side of things: UpdatePanel1.Update(); UpdatePanel2.Update(); This causes the

Postback problem for my custom control load wizard

匆匆过客 提交于 2019-12-13 20:09:17
问题 I have some problem that happens when controls are loaded in init and it still doesn't help me to get proper postback event fired on time. I am trying to create a rich wizard control that will enable switching, links with description, completely customized steps, integration of substeps - by using dynamic control load that is avoids standard asp.net wizard way of loading. Idea is to have on left part navigation, on right part content, or substeps that are run from right part and that go over

programatically creating GridView but postback when update clicked prevents RowUpdating from being called

断了今生、忘了曾经 提交于 2019-12-13 16:29:04
问题 I'm just having an issue I'm hoping someone will be able to give me a few pointers. I have an asp page which is programatically creating multiple gridviews on the same aspx page depending on a variable set of values retrieved from the database. As I am programmatically creating the GridView in code behind, I have to create the gridview gridviews each time the page loads, on postback, oninit etc. I currently create the gridviews within the OnInit function of the page. This all works fine

Restore a drop down selected item after postback

落爺英雄遲暮 提交于 2019-12-13 13:28:18
问题 THE IDEA I'm trying to do a very simple thing - refresh page when an item of the drop down list is selected. Selected item of the dropdownlist is passed to the query string as a parameter. Page reloads. Then parameter is taken from query string and used to restore selection of the drop down list. Parameter keeps the value of the selected item. THE PROBLEM Real selected value is not passed to the query string parameter, it's always "0". DropDownList never gets last selected item, it always

kendo combobox reset after loading back view from controller

两盒软妹~` 提交于 2019-12-13 08:08:06
问题 I have a kendo combobox @(Html.Kendo().ComboBox() .Name("ddSystems") .Filter("contains") .Placeholder("-- Select --") .BindTo((IEnumerable<SelectListItem>)ViewBag.systemList) ) Onchange, a textbox is loaded in ajax. A submit button posts the textbox value and combobox value to the controller. When I get back to the view, I need ddSystems to be reset to empty. I used $('#ddSystems').data('kendoComboBox').value(null) and $('#ddSystems').data('kendoComboBox').text('') but it always retains the

Gridview inside UpdatePanel on ModalDialog not updating after AsyncFileUpload

别说谁变了你拦得住时间么 提交于 2019-12-13 05:52:19
问题 I have a GridView inside an update panel, and a AsyncFileUpload (outside the Update Panel) that I am using to upload Images. All these are in a ASPX page called using the SHOWMODALDIALOG . What I'm tying to achieve: 1. As soon as the file upload completes, the Update Panel updates, and the gridview displays the image the user just added. The problems I'm facing: 1. The Gridview is not refreshing, even though I have a Databind event after the file is uploaded to the database. The Update Panel

Asp.Net: Restoring client-side SelectedItem of DropDownList on server-side

折月煮酒 提交于 2019-12-13 05:04:41
问题 So I have a dropDownList on my page that contains hundreds of items. The user can filter this DDL by typing some text into a textbox. The DDL then gets filtered accordingly (all items that do not contain the entered text are removed via JavaScript). The user then selects his item and presses a button. Usually, this would cause an error because the DDL has been altered and ASP validates the PostBack data. However, with EnableEventValidation="false" you can turn off this behavior and the page

Asp.net DropDownList isPostBack is alwasy false

独自空忆成欢 提交于 2019-12-13 04:32:16
问题 I'm new to ASP and I've come across a problem that I've been at all day! im using a and my postback is constantly returning false, thus my selectedIndexChanged method never gets a chance to run! Here is my code: <table border="1"> <tr> <th> Build version: </th> <th> <%-- Html.DropDownList("Builds", null, new {@onchange = "onChange(this.value);" }) --%> <%-- Html.DropDownList("BuildID", (SelectList) ViewBag.Builds, "--Select One--") --%> <%-- Html.DropDownList("BuildDD", (IEnumerable

DropDownList lose index after PostBack

此生再无相见时 提交于 2019-12-13 04:31:11
问题 I have a dropdown which I fill with data from a SQL server. I fill the dropdown dynamically in the Page_Init() Event. Depending on the Value, a ListItem is selected. Now the problem is, that when I select another Item in the dropdown, that after the postback the selection is reset to the first item in the dropdownlist. This here is a basic version of my code which does not work: ArrayList AD_Group_Members = ActiveDirectory.GetMemberOfGroup("AD-Group"); ArrayList ListMachines = SQLQuery.Read(