.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

IE7 Button Postback issue

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

My company's portal page for our customers (we are a small ISP)  is undergoing a redesign and I'm having a weird issue with an asp.net button in a login control.  

Our existing page is working well with a few ad rotators, a literal that is used to display transformed xml news feeds and a couple of panels that are used for logging into our webmail.  One panel holds the username and password textboxes as well as a remember me check box and a button.  The button has the OnClientClick and the PostBackURL set.  The OnClientClick runs a javascript function that sets a cookie if the user checks the remember me checkbox, other wise it does nothing.  The postbackurl is set to the login page of our webmail which is a php site hosted on another server.  The other panel hold a couple hidden textboxes and a linkbutton with the postbackurl set to the same webmail login page.  This panel is only set to visible if the page detects the cookie mentioned before.

 Our designer has designed a new html portal page and I am tasked with making the asp.net bits work.  I've basically copy and pated the html code into a new asp.net page and then copy and pasted the ad rotators, literal and other controls needed for the login portion.  I've also copy and pasted the code behind that supports the literal and cookie h

View Complete Post

More Related Resource Links

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

(Imperfect) Solution to TreeView Postback / Client-Side Node Selection Issue


I've seen this question posted on all corners of the web... "How do I disable "AutoPostBack" on the ASP.NET 2.0 TreeView control?!"  Unfortunately, most of the answers either don't work, miss the point (don't work right), or boil down to "You can't do it."  I happen to know that this behavior worked perfectly in the IEWebControls TreeView that Microsoft released as an add-on prior to ASP.NET 2.0, however.  So I set out to find a solution for the ASP.NET 2.0 TreeView issue.

In a nutshell, the behavior that I and others are looking for is to have a TreeView rendered in a page that allows the user to expand, contract, and select nodes within the TreeView without causing a PostBack to the server.  This implies two things: (1) the most recently-selected node should be recorded as the currently-selected node [i.e., at PostBack time, the most-recently selected node is actually represented as the SelectedNode]; and (2) the selected node should exhibit the SelectedNodeStyle as specified in the TreeView declaration.

It appears that the TreeView engineers saw only two possible outcomes from selecting a leaf node in a tree: (1) immediately posting back to the server, or (2) immediately navigating to another web page.  They apparently did not consider option (3) just allowing selection in-place on the client, while waiting for a click on so

Standard HTML button causes postback in FF?

Hello,     I'm doing some work with Javascript and I'm having an issue getting my site to work correctly in firefox.  I have the following button: <button id="myButton" onclick="SomeJavaScriptFunction('myParam')">Button</button> When I click on this button in IE7, it simply runs the javascript function and stops When I click on this button in FF, it causes a full page postback.  Why? Is there a good workaround for this issue? Thanks, Joshua Foulk

disable postback on a button

Hey guys, I'm pretty new to asp.net and having some troubles.   I have a button whose sole purpose is to set  div.visible = true There is a calendar control on my page and I need the selected date to remain selected after I hit this button. Right now if I hit the button it refreshes the whole page and sets the calendar's selected day back to date. today   Any ideas?  

Code Behind (C#) - Postback - "If (this button was clicked) postback to this address, otherwise, do

Hello!!I have three buttons at the bottom of my form. Two of the buttons make the form invisible and make a Success message Visible.I need all three buttons to call SubmitForm Function to send us an email with the completed form.The third button is a PayPal button which I would like to postback to a different url after submitting the form via email.How can I change its Postback url in C# in the code behind.P.S. I tried Server.Transfer... got an errorThanks

change tab index by pressing enter button widthout postback

hi .  i have 3 textbox :<asp:textbox id="textbox1" runat="server" text="01" ></asp:textbox><asp:textbox id="textbox2" runat="server" text="02" ></asp:textbox><asp:textbox id="textbox3" runat="server" text="03" ></asp:textbox>  how i can focus on textbox2 from textbox1 by pressing enter button (widthout postback)?

How to manage postback on crystal Report viewer next page click button clickj

 Hi,       I am using Crystal Report on my ASP.NET Fw. 3.5 project. My report contains 100+ pages. When I click on next page button on crystal report viewer control my whole page gets postback to server and then second page appears. This take same time when first time report gets loaded.     Any suggestion how to imporve user experience in thiss case?   Nilkanth Desai   

Viewstate issue when calling button click event from Javascript

I have a javascript that asks a confirmation on search click. If the user has made some changes to the data in grid (gridview) on click of Search, a confirmation is asked to Save or Continue Search. If Yes, Save the records by invoking Save click from javascript. If No, Search click is invoked. While Search click happens correctly, Save click results in an error which reads like this..  "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. " I know the Viewstate is what causing the problem, where the control is not loaded but script is trying to invoke it's click event. Any help is appreciated. At the end of the day, all i need is to invoke Save click from javascript.   -- Viswanth VG  

Browser back button issue when ViewState stored in DB.

I implemented the solution of storing the ViewState in DB (since we were getting lots of Invalid & Corrupt Viewstate errors on our site daily) as given in the following website:http://weblogs.asp.net/adweigert/archive/2004/03/09/86628.aspxThe solution was implemented in one of the aspx pages on our site that behaves like a wizard (not using the wizard control though). After starting to store the viewstate in DB, the Invalid ViewState errors were eliminated completely, but I am now facing the following problem:1) User selects radiobutton1 of the two radiobutton choices on Page 2 of the wizard, a postback happens which displays some extra information on the page based on the selection. Now the user hits the next button on the page that also does a postback & displays Page 3.2) On Page 3, user hits the "back button" of the browser instead of the "previous page" button that is available on that page.3) This displays Page 2 from cache in original state(without any selections made). When user now selects radiobutton2, a postback is supposed to happen, but it does not. User then clicks "next" button on Page 2 (a postback does happen here however), & Page 3 is displayed, but it still thinks that radiobutton1 was selected (the original selection that was made in step1) on the previous page & hence displays information accordingly.I am assumi

Button forces postback in updatepanel inside Popup

I have an update panel which is inside a Modal Popup Extender. When I click the Refresh Report button it always calls a postback. I need to stop it from posting back. Ideas?

Clear back button to force a postback

I am using asp.net 3.5 and use master pages for most of the website. I need to make sure that users after they logout are not able to use the back button to see in cache data. Thanks. 

XML Radio Button Selection Issue


Hi All,

I used some code i found on the internet and a little of my own to come up with a custom radio-button that will add a list field to the querystring as a parameter. This code seems to work fine when i stick it in a dataview in its own column, but SharePoint Designer does not seem to like my closing tag "</input>" which will lead SharePoint Designer to occasionally try to fix the code itself, which actually breaks it. I'm not an XML expert by any means, so if anyone could please tell me why the code doesnt seem to be XML certified, i would really appreciate it. Code below:

<input type="radio" value="{@TID}" name="radioMain">

ASP.Net Postback using javascript for Radio button list


Hi There,

My current structure:

1. An asp.net radio-button list with autopostback = true. The radio-button list has 2 items - Yes and No.

2. An asp panel that has 2 textbox.

Current behaviour:

When the user clicks on the radio-button list (i.e. Yes), the panel is made visible.

My clients wants the same functionality without the page refresh (i.e. the postback). I tried looking through a lot of forums and articles and couldn't find the any article that would show an example for drop-down list or radio-button list.

Any help is much appreciated..!


Help! Can't find dynamic button's postback in page.request.form??


Okay, I know that dynamic buttons and buttons in general don't use a typical postback and they post through the page.request.form.  Okay, so in visual studio, I was able to determine that page.Request.form and in the all-keys property, i SEE my button there.  It is the last item in all-keys.

When I am clicking this dynamic button which is in an updatepanel, the script below does not detect it as a button, it is still showing it as null:

public static Control GetPostBackControl(Page page)

            Control control = null;
            string ctrlname = page.Request.Params.Get("__EVENTTARGET");
            if (ctrlname != null && ctrlname != string.Empty)
                control = page.FindControl(ctrlname);

Button not preserving ID after partial postback in updatepanel?


I've created a dynamic button from another control outside of the update Panel.  The button is given an ID and such.  When the button is click, a postback occurs and I've re-created this button during Page_Init, Page_PreLoad, and Page_Onload and NONE of them is preserving the value. 

The only way for me to find the control was to look at the Page.request.form's allkeys and compare the string with a any text string that contains: Button.  Because I ID'd teh button as: ButtonRow_0Col0.  But the actual ID is null.  However, when traversing through page.request.form, the allkeys shows that ID with no problem.

So how come the actual ID is lost after a partial postback yet, the page.request.form's allkeys can pull out its allkey's value??


How do you save state of a toggle button after partial postback?


lets say you  have the toggle buttons from this page: http://www.filamentgroup.com/examples/buttonFrameworkCSS/

and you put it in a UpdatePanel AJAX...  so lets say on a partialpostback.. when you re-create teh controls on server-side, the state of whether or not those buttons were pushed is long-lost and gone.. so how then how do you remember those states?

Can I save each button state into viewstate or session state?  regenerate each button then call the javascript function to change its color-state depending on the session state variable?


asp:button OnClick/Postback not working in IE7 & IE8


 I have a content page that has a form in it. The problem that I am having is that I get no response from the submit button for when clicking on it in IE 7 and 8. I have also siccessfully tested it in Firefox, Chrome and Safari.

This seems like a fairly common problem but I have yet to find a solution that works. I found some posts that suggested that there might be a problem with the aspnet_client folder so I ran aspnet_regiis -i and restarted IIS. I even when so far as to reinstall the asp.net framework and IIS. No love there.

I have verified that I have only one form tag in my master page also.

I also tried messing with the buttons UseSubmitBehavior, but that started up a whole mess of other problems like form field vaules not being posted.

Maybe there is something simple I've been missing becaue I've been looking at it too long ;) Fresh eyes would be appreciated.

Here is my master page:

<%@ Master Language="C#" %>
<script runat="server">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend