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

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

Standard HTML button causes postback in FF?

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
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

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.

Html Link Button


Hi All,

I would like to create a html link button(in aspx page) so that the page could not post back and some controls to display on clicking link button.

Can any one of you help me regarding this issue?

Let me know if you have any queries.



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   

is it possible to add a new button to the standard window?

is it possible to add a new button to the standard window close to the 3 buttons ?  

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. 

Dropdownlist posted back html content,firefox alarms "Invalid postback or callback argument"


Ok probably you might have seem a dozens of post's titled "Invalid postback or callback argument" but this one is different.

Application that i am creating is simple content editor using the FCK editor.net Control (the content is HTML Encoded before saving t0 DB and then Decoded back again when displaying). just a simple drawing of of its ui is like this

DdlPages < listing the pages Whose regions/controls value can be edited> Databound

DdlRegions <listing the controls whose content can be edited> Databound on DdlPages selected index change

===========Retreived from DropDownlistRegions selected Index Change===========

txtName <a simple name for the region, user friedly identity >

==> FCK Editor <==

<Save Button> <Discard Button>


I am not such a good designer but hope you understand the UI layout.

This thing works flawless on IE 6,7,8


DropdownlistRegions holds the content to be displayed in the txtName and FckEditor. This is done by forming a custom concatenated column containing the txtName and Fckeditor(HTML content) separated by a ' ^ ' character. and then databound the column to the Dropdownlist value property.

So on selected index chang

IE7 Button Postback issue


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

catch the html button click event on a class file including html text box value.


I want to catch the html button click event on a class file including html text box value..

<p><input name="" type="text"  value="Enter Name*"/></p>
<p><input name="" type="text"  value="Enter Email*"/></p>

  <input name="Input" type="submit" value="Submit" />

plz tell me how can i do this..

Editor Custom Button with template HTML



How can I add button to the toolbar that will add a small html template text to content?

For example, when I click on that button, I want to "<table><tr><td><b>Hello world</b></td></tr></table>" be added to the content.

Thanks in advance,


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