postback

RaisePostBackEvent not firing

I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs). The control is implemented in two different user controls. In one control, RaisePostBackEvent is fired on the server-side when __doPostBack is invoked. In the other control, RaisePostBackEvent is never invoke...

Postback with Modified Query String from Dropdown in ASP.NET

My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns). They can select a report using two methods. With SelectedReport=MyReport in the query string, or by selecting it from a dropdown. And it's a common case for them to come t...

SimpleModal breaks ASP.Net Postbacks

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

How to check if page is postback within reserved function pageLoad on ASP.NET AJAX

I'm looking for a way to check within pageLoad() if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time. This is similar to Page.IsPostback property within code behind page. TIA, Ricky ...

Setting viewstate on postback

I am trying to set a ViewState-variable when a button is pressed, but it only works the second time i click the button. Here is the codebehind: protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { lblInfo.InnerText = String.Format("Hello {0} at {1}!", YourName, DateTime.Now.ToLongTimeString()); } } private...

Postback events from within DataView

I'm presenting information from a DataTable on my page and would like to add some sorting functionality which goes a bit beyond a straight forward column sort. As such I have been trying to place LinkButtons in the HeaderItems of my GridView which postback to functions that change session information before reloading the page. Clicking ...

__doPostBack not rendering on postback

I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas? This is what I'm missing after the postback: <script language="javascript" type="text/javascript"> <!-- function __doPostBack(eventTarget, event...

Prevent Multi-Line ASP:Textbox from trimming line feeds

I have the following webform: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestWebApp.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="serve...

Trouble with selected radiobuttonlist value on postback vb.net

I have a radio button list on a page that is used to configure products. when the page loads the first time the first list of options is displayed. you select one of them then click a "Next Step" button and the page posts back and shows a new radio button list for step 2. Now if i click a "Previous Step" button i can easily get the previ...

ASP.NET - Is it possible to trigger a postback from server code?

Is it possible to to programmatically trigger a postback from server code in ASP.NET? I know that it is possible to do a Response.Redirect or Server.Transfer to redirect to a page, but is there a way to trigger a postback to the same page in server code (i.e. without using javascript trickery to submit a form)? ...

ASP.NET Custom Controls - Alternatives to PostBack?

On my journey into the depths of custom ASP.NET control development I am obviously getting my head around the ASP.NET PostBack model and how it affects control development. I understand that controls have no "lifetime" in ASP.NET, and therefore must be re-initialized on each and every page load. We overcome this by persisting the object...

User Control created dynamically not able to handle events on PostBack

I have a user control which is loaded in the page dynamically using the following code in Init of the Page. Dim oCtl As Object oCtl = LoadControl("~/Controls/UserControl1.ascx") oCtl.Id = "UserControl11" PlaceHolder1.Controls.Clear() PlaceHolder1.Controls.Add(oCtl) The user control also contains a button and I am unable to capture th...

How do I chain my own JavaScript into the client side without losing PostBack functionality

So I was reading these Asp.Net interview questions at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about. ...

ASP.Net: User controls added to placeholder dynamically cannot retrieve values.

I am adding some user controls dynamically to a PlaceHolder server control. My user control consists of some labels and some textbox controls. When I submit the form and try to view the contents of the textboxes (within each user control) on the server, they are empty. When the postback completes, the textboxes have the data that I ...

How do I make an onclientclick post back using jquery? asp.net

Hey guys, I need help. I want to recreate the the update panel postback without using a update panel to do the postback. What is the generic method for doing this? For example, on stackoverflow, when you vote up or down on a question it does a postback to update the database and I would bet they didn't use an update panel. What do I...

Can't find dynamic controls in datagrid on postback

Using .NET 1.1, I have a DataGrid that contains three columns for each row. Row one has a label with some text. Row three will always have two radio buttons and two checkboxes and those are in the HTML side of the page. Row two will have dynamically generated controls (just textboxes for now) and there can be 1 or more per row. These...

Postback Security

I've been working with jQuery and *.asmx web services lately, and I'm trying to be security-conscious in doing so. I figure it would be possible to submit an AJAX request -- even when logged-out -- to a resource that should only be accessible while logged-in. Thus, I include special keys and hashes with each of these AJAX requests in o...

Can you disable an ASP validation on an event click before it postbacks and performs the validation?

(ASP with c#) -Can you disable an ASP validation on an event click before it postbacks and performs the validation? I would like to load some details into a bunch of text-boxes with field validators on them, However I need to Disable the validation of these text-boxes in order to actually fill them as the validation seems to occur at p...

Keeping data in session vs. populate on postback

What is preferable, keeping a dataset in session or filling the dataset on each postback? ...

Clearing a form after POST in Asp.net

Hi, Whats the normal procedure of clearing a form after POST? Just loop through the textboxes and cleat all text? I have an ASP.NET application with several forms and I am trying to avoid them sending the data twice? Thanks ...