autopostback

Calculate total on TextBox's TextChanged() event in asp.Net

假装没事ソ 提交于 2019-12-25 04:15:50
问题 I have a small application as below. In this Material Rate and PO Total are read only fields. I want to calculate the total as per material quantity changes by formula (Total=Rate*Qty). I coded on Material Quantity's TextChanged() and also changed AuotoPostBack to True Code I tried is as below: protected void txtMQty_TextChanged(object sender, EventArgs e) { checkTotal(); } //I am saving Rate in ViewState["Rate"] and retrieving here. private void checkTotal() { Rate = Convert.ToInt32

ASP.NET AutoPostBack is clearing form data

ε祈祈猫儿з 提交于 2019-12-24 03:24:50
问题 I have a radio button list and I want to perform some action when a user makes a selection. <asp:RadioButtonList id="docList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="loginUser" /> However, I get an empty value for docList.SelectedValue . I am guessing this is due to form data getting cleared upon Autopostback . Is there a way I can have AutoPostBack and not lose form data? 回答1: Yes you can by implementing it like this: <asp:RadioButtonList id="docList" runat="server"

Doing a postback without AutoPostBack

半城伤御伤魂 提交于 2019-12-23 09:26:15
问题 I've got a WebForm with two drop down lists, where the contents of the second one depend on the first. So if the user changes the category, the second dropdown needs to be filled with the list of subcategories. This sounds like a typical job for AutoPostBack. However, there's a bit of a problem with AutoPostBack: if the list isn't dropped open, and the user uses the keyboard to make the choice, the postback happens right after the first keystroke. This prevents the user from scrolling down

customvalidator for dropdownlist not being invoked (apparently)

和自甴很熟 提交于 2019-12-21 23:17:36
问题 Writing a custom validator for a dropdownlist that is using autopostback. Seems to ignore the validation altogether. Why is it ignored and is there an easy fix? Note I did not use ControlToValidate asp.net: <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional" Visible="true" RenderMode="Inline"> <ContentTemplate> <asp:DropDownList ID="ddlCommandAssign" runat="server" AutoPostBack="true"> </asp:DropDownList> <asp:CustomValidator id="val_command_assigned" runat="server"

Asp.Net, DropDownList, AutoPostBack and Google Chrome

陌路散爱 提交于 2019-12-17 22:24:44
问题 I've a simple asp.net page (framework 3.5) and an UpdatePanel with a series of dropdownlist I want to populate asyncronously. All works fine in all major browsers (Opera, Safari, IE6, IE7, FF3), but not in Chrome. Chrome seems to ignore the SelectedIndexChanged event who had to make the asynch request. Anyone knows a simple workaround to this? Thanks! EDIT: More Informations As I say to Adam Lassek, the updatepanel refresh after the click to an asp:Button inside of it, but it doesn't work

Dropdown OnSelectedIndexChanged not firing

烈酒焚心 提交于 2019-12-13 14:03:22
问题 The OnSelectedIndexChanged event is not firing for my dropdown box. All forums I have looked at told me to add the AutoPostBack="true" , but that didn't change the results. HTML: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Current Time: " /><br /> <asp:Label ID="lblCurrent" runat="server" Text="Label" /><br /><br /> <asp:DropDownList ID="cboSelectedLocation"

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

Trigger jQuery code on AutoPostBack = true?

巧了我就是萌 提交于 2019-12-12 10:03:33
问题 I have a bit of jQuery code that applies a phone number mask to a text field in a form: <script type="text/javascript" src="../../../js/jquery.maskedinput.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $.mask.definitions['~'] = '[+-]'; $('.phone').mask('(999) 999-9999'); }); </script> It works just fine when the user first enters the form or if the use refreshes the page. However, there is a DropDownList that will allow users to select a different shipping

Retain Style Properties on postback

前提是你 提交于 2019-12-12 02:45:16
问题 I have a div and 4 drop-down controls. Default div is hidden using Style="display:none" . First drop-down don't have autopostback event. Div's display property is changed on few values of 1st drop-down. Once its is visible. User can change values in drop-down field 2/3/4 which is having auto postback true. As user changes value in any of the 2-5 drop-down controls, postback triggers and set the display property of that Div to Style="display:none" . How can I retain display property of div.

Is postback works only in pageload?

蹲街弑〆低调 提交于 2019-12-12 02:22:14
问题 May be this question seems illogical but i want to explore it. I have if statement and i want to postback page within that statement but not in page load. my code is if (Request.QueryString["HotelID"] != null) { //here i want to set autopostback true } so my page post back when it have query string. 来源: https://stackoverflow.com/questions/15540048/is-postback-works-only-in-pageload