postback

Autoposting Radiobuttons in ASP.NET MVC view

Hi, I'm trying to add a couple of radiobuttons at the top of a View (using ASP.NET MVC). I want the two radiobuttons (option 1 and option 2) to cause the page to be refreshed/autoposted when changed. The two radiobuttons live inside a separate .asxc (Menu.ascx), and added with Html.RenderPartial in a List.aspx page. The two options in ...

Linq to SQL - Retain DataContext across post-backs?

I read Rick Strahl's post about DataContext lifetime management, and some of the other related questions on Stackoverflow. If they contained an answer to my question, I must have missed it. I generally follow the atomic approach and instantiate a DataContext for a unit of work when it is needed, and dispose it afterwards. This worked w...

Problem grasping webpart communication

Hi, I'm having trouble understanding some web part communication code, and how to make it work as needed. I'm fairly new to web parts, so I figure I'm over complicating it. I have public interface IFormTypeRID { int FormTypeRID { get; } } For this page, I have a ListControl on the left which is a web part. When you select somethi...

Why is my view state not storing a dynamic control adding using Controls.Add?

I'm trying to load a control depending on a category ID that is selected from a drop down list. This is this code i have within a switch statement to show a usercontrol. This was the only way i knew of doing it and having reusable views. I'm open to other methods as i've read a few people saying to avoid dynamic loading? var control = ...

AjaxControlToolkit combobox and focus behaviour

I have a requirement in a web application to duplicate the winforms combobox, with both the ability to select from the drop down list and to type text into the control. I've been looking at the AjaxControlToolkit combobox control since it gives the two behaviours along with other nice things like autocomplete. This is working fine but I...

ASP.Net viewstate questions on form postbacks

Let's assume I have a very simple form, with a submit button and a dropdown list. When I change the list entry and hit submit, at what stage in the postback processing does the viewstate reflect my changed list entry? According to O'Reilly's Learning ASP.Net 3.5, there are two loads taking place-- one before form validation and another...

ASP.Net Checkbox value at postback is wrong?

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 Languag...

Stop postback on TextChanged

I have a textbox in an aspx page that has a TextChanged event attached to it. I also have a validator attached to the textbox. When the text is changed, the validate triggers but in case there is an error the textchanged event is still called. Do you know if it's possible to stop the postback on textchanged if the validator fires? <asp...

Postback intermittently not working with ASP.NET 3.5 and IE?

We have an ASP.NET application that we recently migrated onto a new server with IIS7 and .NET 3.5. In this new environment, some users that are on IE (6, 7, or 8) are experiencing bizarre intermittent problems with postback not working on ASP.NET buttons. (you click the button and nothing happens) The issue happens sporadically. Someti...

Dynamic usercontrol postback initialization

I have a user control that loads other user controls dynamically. The issue is that on postback my controls don't exist. Now i'm under the impression i have to re-initialize them. Now to do this since they're UserControls and use the ascx file none of the UserControl's controls have been initialized in the empty constructor. Questi...

Dynamic Controls Created from Database Data

Hi, I have been working for a couple days trying to figure out how to do this. Working in C# I have a List of data being pulled from various database tables. I want to create different DropDownLists from this data that will persist across PostBacks. One way I was able to tinker through this was to parse the data into List> and nest t...

so is it a postback or not

I'm causing a postback by clicking an asp:button. I end up in a breakpoint on Page_Load, where IsPostBack == true. Then, one breakpoint later, I end up in Page_Load where IsPostBack == false. What the heck is going on? I'm trying to understand someone else's code. ...

Getting ASP.NET ImageButton OnClientClick changes to the server

I use an ASP.NET ImageButton on my website. When a user clicks on the ImageButton, a javascript is fired via the OnClientClick event. The script changes the ImageUrl of the ImageButton. On the same page, I have a submit button. Clicking the button causes a post back to appear. Is there a way of knowing the correct ImageUrl of the Ima...

Firefox adds two new line characters for the radio button list selected value in asp.net

Hi, I have a asp.net web page with a drop down list (RadioButtonList), one of the list item in that list is long text so it wraps to the next line (the list is nested inside a table). I have a auto post back enabled for the list and i handle selection change event. Now if I select that list item with the long text, the selection change e...

Catching a RaisePostBack in the Master Page

Hi, I'm wanting to throw a __DoPostBack from a master page (C#, ASP.NET) and catch it with the master page's RaisePostBackEvent method. At the moment it gets thrown from the master page though the content pages also have a RaisePostBackEvent method and these are what are catching my Master Page's postback. I'm wondering how I would go ...

Controls are empty after submit

I have a checkboxlist and textbox controls on my asp.net page and the are dynamically created and added to the page. When I populate the values and submit the form, the values are empty by the time it hits the server. Any help? ...

ASP.NET Bind to IEnumerable

Hi, I'm passing a the type IEnumerable to my view, and for each item I output a html.textbox to enter the details into. When I post this back to my controller, the collection is empty and I can't see why. public class Item { public Order Order { get; set; } public string Title { get; set; } public doubl...

Checkbox in TemplateField in Gridview loses checked on postback

I have a gridview with a template field. In that template field is a checkbox. I have a submit button outside of the gridview to assign the records that were checked. On the postback no checkboxes register as being checked. Here is my Code: <Columns> <asp:TemplateField> <ItemTemplate> ...

C#.Net - RadioButton Control adapter and postback

I have a radio button control adaptor that attempts to render the radio button control with the CSS class as part of the input tag, rather than as a surrounding span. public class RadioButtonAdapter : WebControlAdapter { protected override void Render(HtmlTextWriter writer) { RadioButton targetControl = this.Control as R...

.net c# postback overwrites bound textbox

I have a gridview, the contents of which are provided by accessdatasource the data displayed is dependant on a dropdown list which has a postback event The page loads User selects an item from the dropdown page reloads with new data in the gridview So far so good I have then added a textbox to the grid view (no I can't to use the ...