postback

Set a hidden field value after postback.

I have a component that determines a value on a postback event. protected void Button_Click(object s, EventArgs e) { HiddenField.Value = 5; } There's more involved in the value of course, but HiddenField is an asp:HiddenField control with runat=server set. I have in my javascript: var id = $("#<%= HiddenField.ClientID %>").val();...

Forcing ASP.NET WebForms to render __doPostback() scripts

One of our ASP.NET WebForms 3.5 pages just suddenly decided not to render the __doPostBack() javascript method, along with the supporting <hidden> fields, anymore. Everything else seems OK on the page - the only thing I changed was that I removed a postback handler on a SelectList control, and changed AutoPostback from True to False on ...

ASP.NET/HTML input button value on postback

According to the info in: http://stackoverflow.com/questions/669797/which-values-browser-collects-as-a-postback-data the value of the HTML input button is sent in a post back. I'm testing in ASP.NET with IE and I am not finding this to be the case. The markup for my test case is: <%@ Page Language="VB" AutoEventWireup="false" CodeFil...

How do modern web-apps/sites do postbacks? javascript/ajax, <form> or X?

Hey all. I've tried to Google and research this, but without luck. I am curious to know how "modern" web-apps/sites do postbacks, meaning when they are sending back user-input to the site be processed. Do modern sites still use the old fashion <form>-tags or do they use some sort of javascript/ajax implementation? or is there even a t...

Classic asp radiobutton groups get values

Is there a way to iterate radio groups on a form post to do something with each radio button group? I have a varying number of radio button sets and need to get values and id's out of each of them on a postback. ...

.NET TreeView doing Postback instead of Expand when called through AJAX and rendered using RenderControl

I have a page which is using a TreeView. The TreeView is placed within a user control for ease of code reuse. If the user control is loaded directly on to the page, by using a Register for the user control and then placing it on the page, then it works fine - the nodes are expandable. In order to avoid having extra code on the page load...

An ASP.NET Chart control is refreshed on page post back -- but I don't want it to be.

An ASP.NET Chart control is refreshed on page post back -- but I don't want it to be. In my aspx, I have: <asp:Panel runat="server" ID="PanelRight" CssClass="roadmapRight"> <asp:Chart ID="ChartRemainingDaysHistory" runat="server"> <Series> </Series> <ChartAreas> <asp:Char...

jQuery call __doPostBack on LinkButton

I have a LinkButton that I need to perform a click on to cause a postback. The actual link target is: javascript:__doPostBack('ctl00$c1$btnRefreshGrid',''); Clicking the link does perform the postback, as verified by a breakpoint in the code-behind. Also pasting javascript:__doPostBack('ctl00$c1$btnRefreshGrid','') in the address bar o...

DataGrid button - Invalid Postback or Callback

I have setup a DataGrid with a number of columns and a checkbox and column at the end of the row. I am also changing the layout of the datagrid on the OnItemCreated event which changes the layout of the datagrid by expanding the rows with the "Rowspan" attribute and remove the extra columns and controls where they are no longer required...

ASP.NET/JavaScript - Why Isn't "Return False" Not Preventing Postback?

Hi Guys, I feel like i've done this scenario plenty of times, and it usually works, so im obviously missing something. Here's my server-side ASP.NET Button: <asp:Button ID="btnFoo" runat="server" Text="Foo" CssClass="button foo" OnClientClick="foo_Click();" /> Which get's rendered on the client as: <input type="submit" name="really...

ASP.NET Postback problems in IE8

Hello All, I am working locally on an ASP.NET site and am experiencing problems with postbacks in IE8. I have a page with a repeater that builds a table and each row has a LinkButton on it that is used to delete that row. In FireFox and Chrome, the button works as expected - the forms posts back and all the values from the form are ava...

Passing information between windows ASP.net

Here is the problem: I have a HTML page called test.html and an ASPX page called getitem.aspx. Now what I want to do is, upon clicking a button on test.html, I want the getitem.aspx page to open in a new dialog and allow entry on a text box. After clicking the OK button on getitem.aspx, this dialog should close and the entry should be p...

ASP.NET - fileupload using input file

Hi, I am using VS-2005. In my website I have used the html input control with type=file. The problem is that when I place this control inside an 'UpdatePanel' the 'PostedFile' property becomes 'Nothing' on postback. So in order to get things working I have removed the 'UpdatePanel' and things are working fine. However, I am intereste...

Stopping select.change from posting back

Hi, this problem is part of a bigger page but I've simplified the code to provide an easy example of what I'm talking about. Basically I have an ASP dropdownlist with AutoPostBack="true" and I want to do some javascript client side which can stop the postback if necessary. However, I can't get it to stop the postback. <script type="te...

Running Javascript after a ASP.NET postback from a client script block injected from a master page

I cannot get Javascript to run after a ASP.NET postback from a client script block injected from a master page Below is my master page logic, and it gets hit on a postback, I have confirmed with a breakpoint. namespace MyAwesomeProjectThatWillTakeOverTheWorldIfNotForThisIssue { public partial class CommonContent : MasterPage { ...

Dynamically added controls causing static button event to only fire after second click

I have a custom user control that consists of a dynamic list of controls, along with a static button that is declared (along with the OnClick declaration) on the aspx page. The button shows or hides a panel containing the dynamic control list. I am finding a problem that I presume is related to the dynamically added controls, where the...

postback (a la ASP.NET) in other frameworks?

I am researching web frameworks that are in common usage. In ASP.NET there is the notion of a "postback". Specifically, the framework automatically adds a hidden FORM to each page which can be submitted by JavaScript with various state parameters, etc. The "action" URL for this form is always the current page's URL, including its quer...

Updatepanel in usercontrol driving me crazy

Hi all, I've build a pager to enable pagination for a repeater control. The page structure looks like this: MasterPage -> Page -> Dynamic usercontrol -> Dynamic usercontrol with repeater inside updatepanel Now what I'm trying to do is just a simple updatepanel.Update() procedure but it's just not working. When debugging I ...

ASP.NET dynamic Command Button only fires every other time

Similar to this question here ASP.Net Dynamic Command Button Event Not Firing but with a slightly different problem. Provided below is a (very) condensed version of my code. protected void Page_Load(object sender, EventArgs e) { RenderDataItems(); } private void RenderDataItems() { pnlDataItems.Cont...

ASP.NET - Dynamic Control Values & Postback

I'm trying to persist the contents of a textbox through a postback, and I've exhausted all of my effort but can't get it working right. What should happen is: User selects a radiobutton Depending which button was selection, a usercontrol is loaded to specify some data and a viewstate to say which enum type it's equivalent to. When th...