postback

How do I make a Textbox Postback on KeyUp?

给你一囗甜甜゛ 提交于 2019-11-27 03:50:58
I have a Textbox that changes the content of a dropdown in the OnTextChanged event. This event seems to fire when the textbox loses focus. How do I make this happen on the keypress or keyup event? Here is an example of my code <asp:TextBox ID="Code" runat="server" AutoPostBack="true" OnTextChanged="Code_TextChanged"> <asp:UpdatePanel ID="Update" runat="server"> <ContentTemplate> <asp:DropDownList runat="server" ID="DateList" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Code" /> </Triggers> </asp:UpdatePanel> So in the codebehind, I bind the dropdown on page load. The

Asynchronous and synchronous postback in ASP.NET

假装没事ソ 提交于 2019-11-27 03:36:51
问题 What are the differences between asynchronous and synchronous postback? 回答1: From Plz tell me difference synchronous postback and asynchronous Postback Asynchronous postback behaves much as the synchronous postback, All the server page life-cycle events occur. But in rendering phase, in an asynchronous postback only the contents of the update panels are sent back to the browser where as in synchronous postback all the page content is refreshed/sent back to the browser. See also Partial-Page

SimpleModal breaks ASP.Net Postbacks

元气小坏坏 提交于 2019-11-27 01:31:09
问题 I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which is not really acceptable. There is one source I've found with a workaround, but for the life of me I can't get it to work, mostly because I am not fully understanding all of the necessary steps. I also have a workaround, which is to replace the postbacks, but it's ugly and probably not the most reliable. I

What is the difference between Page.IsPostBack and Page.IsCallBack?

早过忘川 提交于 2019-11-27 00:17:02
问题 I've recently ran into some code that checks Page.IsCallBack but I wasn't sure how it is different from Page.IsPostBack . Can anyone enlighten me? Edit : Are they mutually exclusive or can both occur at the same time in a given situation? 回答1: Page.IsCallBack It is getting a value indicating whether the page request is the result of a call back. Its a special postback, so a round-trip always occurs; however, unlike the classic postback, the script callback doesn't redraw the whole page.

Reset session timeout without doing postback in ASP.Net

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 23:34:56
问题 Is there any way to reset the session timeout without doing postback? In this scenario I don't just want to hide the postback from user, I need to reset the timeout with out postback. On my page I need to popup a dialog and inform the user that his session is timing out and if he wants to keep it alive he needs to click on a button. Now, when he clicks on that button I do not want to postback the page because it will cause issues with the data. (Not getting into the issues) Based on the

Maintain Panel Scroll Position On Partial Postback ASP.NET

删除回忆录丶 提交于 2019-11-26 22:24:28
I have a gridview that putted in ASP.NET Panel. both of panel and Gridview are in an UpdatePanel. there is a column in gridview that Causes Partial PostBacks. i want to Maintain Panel Scroll position on those postbacks. Is there any way? regards. There is no built-in facility to resolve it in asp.net However, there is a workaround for this problem; You need to handle it with javascript. Solution is mentioned here: Maintain Scrollbar Position Inside UpdatePanel After Partial PostBack Edited 20-May-2012; after seeing the comments <form id="form1" runat="server"> <asp:ScriptManager ID=

ASP.Net Checkbox value at postback is wrong?

烂漫一生 提交于 2019-11-26 18:20:45
问题 We have a checkbox that is initially disabled and checked. It is then enabled on the client side through javascript. If the user then unchecks the box and presses the button to invoke a postback, the state of the checkbox remains as checked on the server side. This is obviously undesirable behaviour. Here is an example. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testcb.aspx.cs" Inherits="ESC.testcb" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www

How to detect/track postback in javascript?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 18:06:59
问题 How to detect/track/check postback in javascript(e.g in asp.net Page.isPostBack())? Any suggestion? 回答1: ASPX: <input type="hidden" id="_ispostback" value="<%=Page.IsPostBack.ToString()%>" /> Client-side Script: function isPostBack() { //function to check if page is a postback-ed one return document.getElementById('_ispostback').value == 'True'; } PS: I have not tested it but I've done somthing similar before and it works. 回答2: In some cases, you may want to check for postback without any

ASP.NET DropDownList not retaining selected item on postback

∥☆過路亽.° 提交于 2019-11-26 16:34:51
问题 I have a ASP DropDownList that gets populated on the Page_Load event, after i select an item and hit a button the selected item gets cleared and the first item in the DropDownList gets selected. (The DropDownList is only populated when the page is not postback) Help please if (!IsPostBack) { List<Country> lCountries = new List<Country>(); List<CompanySchedule> lCompanySchedules = new List<CompanySchedule>(); this.Load_Countries(lCountries); this.Load_Schedules(lCompanySchedules); if

ListItems attributes in a DropDownList are lost on postback?

喜欢而已 提交于 2019-11-26 16:07:21
A coworker showed me this: He has a DropDownList and a button on a web page. Here's the code behind: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListItem item = new ListItem("1"); item.Attributes.Add("title", "A"); ListItem item2 = new ListItem("2"); item2.Attributes.Add("title", "B"); DropDownList1.Items.AddRange(new[] {item, item2}); string s = DropDownList1.Items[0].Attributes["title"]; } } protected void Button1_Click(object sender, EventArgs e) { DropDownList1.Visible = !DropDownList1.Visible; } On the page load, the items' tooltips are showing, but on the