How to bypass onsubmit event when post back DDL event?

Hello, friends, 

In the source code, there was a JavaScript function isValidInput() for form onsubmit event, i.e., onsubmit="return isValidInput()"

In VS2003, this function was not called when SelectedIndexChanged event in DropDownList boxes was fired.

In VS2008, this function was called when SelectedIndexChanged event in DropDownList boxes was fired.

In either case, DropDownList had property AutoPostBack="true". Therefore,

Before, when a user selected a different list index from DDL, it won't check validation. So, it worked. (It validated inputs only when a user clicked on Send button to submit this form).

Now, when a user selected a different list index from DDL, it WILL check validation. User can go nowhere since he/she need more data based on the selected item in DDL. So, now it does work.

If I get rid of isValidInput() function, events are fired as normal.

How to get around this? Any ideas? (This would be a nightmare if we had to rewrite it in VS.net 2008 since it is a pretty big app)

Thanks a lot for your help.

(Modified from Why SelectedIndexChanged event in DropDownList boxes not firing? )

-1
vbird2k
5/5/2009 12:17:31 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
3678 Views

Similar Articles

[PageSpeed] 38

Do you have, or can you add, a Submit button to the form?  If so, you can move the isValidInput function to the onclientclick event of this button.  That might work for you.


C# <---> VB.Net Translator
-1
MetalAsp
5/5/2009 1:30:58 AM

MetalAsp.Net:

Do you have, or can you add, a Submit button to the form?  If so, you can move the isValidInput function to the onclientclick event of this button.  That might work for you.

Great! Thanks.

Do you know it works for other non-IE browsers?

-1
vbird2k
5/5/2009 1:52:26 AM
Reply:

Similar Artilces:

How to fire events in other web form from other web form ?
Suppose that I have A and B web form. I want to trigger B web form's Page_Load event from A web form. How can I do that ? Thanks in advanced WilbertWilbert Bujn Create a public method in B that call the load method : public void Load(object sender, System.EventArgs e) { Page_Load(sender, e) ; } In the page_load of A, instanciate a B object and then call the function B myB = new B() ; myB.Load() ; Quicky Thank you quicky, it works fine. WilbertWilbert Bujn...

Raise Post back event on Another Event not working
  HiI m extending FileUpload control in ASP.Net 2.0i want to scan file before upload to server...for that i m using a DLL that accepts "FileName" as input and invokes Antivirus programe...it takes few seconds to sacn file and it exposed an event that displays results after scanning is completed.To expose this EVENT which is in DLL to our Page i Attached a custom Event which is implimenting IPostBackEventHandler.this is fine...but when i actually runs the Page that event is not fired. If i debug the custom control then that DLL Event is getting raised but not my custom con...

Form posts back OK, but events not firing?
Here is a new problem that I can't solve: I have a few Link Button controls in the footer of a datagrid.  When I click any of the controls the form posts back, but no events are handled for the link buttons. The strange thing is that the page works fine... in Firefox.  I only see the problem when I use IE6 or IE7.   Where can I begin to debug this?    Hello my friend, Could you provide the source of your page?   Kind regards Scotty   hi pmccombs, without seeing any code, it is hard for us to help u  Jessica CaoSincerely,M...

How to use event before posting back the page, like onUnload event in JS? (C#)
Please tell me the name of event that will be launched just before user leave or post back the page. Something like onUnload in JavaScript just in code behind (C#). Thanks in advance. PreInitInitInitCompletePreLoadLoadLoadCompletePreRenderPreRenderCompleteSaveStateCompleteUnload EXPERT .NET DEVELOPER Hi, Please have a look at this link. It includes all the page events with their explanation and timing in the page load process. http://msdn2.microsoft.com/en-us/library/ms178472.aspx RegardsDon't forget to click (Mark as Answer) on the post that helped to solve your p...

First Button Click posts back but event not triggered. On Second click the event is triggered
ASP .NET 1.1 VS 2003 The web form has copule of dropdown, calendar control and 2 buttons. One of the button has a problem. On first click, page is loaded but button event is not triggered. On second click the page load is called and the button event is triggered. What is going on?   AR We can not possibly help you without seeing some code.Visit http://www.dailytip.net to view your daily tip@! Hi abdur, In your condition, just check if the __doPostBack method is rendered in the Page first time or not. or if ur button name is btnLogin then OnClientclick event call __doPostBack...

How to add event to Web Form from the vs.net designer
 Hi there, I know that when i double click a web form I'm taking to the page_load event.  However, I want to create an unload event by I don't know how to create it from the vs.net designer.  Does anybody know how to create a page unload event from the vs.net designer? Many thanks  Page events are not exposed in the design view. If you are using VB, you should be able to use dropdowns on top of the code editor -> select Page in the left one and the designed event in the right one and editor will generate the code. Unfortunately, C# editor does not p...

how to avoid post back events to fire when a user refreshes a page followed by a Datagrid "Itemcommand" event.
Hi, I have read many posts already in this forum saying about how to avoid post back events to fire when a user refreshes a page followed by a server side event. But all of doesnt seem fruitful for me. My requirement is : 1. Show database records in a dynamically generated datagrid. 2. Show each cell in datagrid as a hyperlink. 3. When user clicks on any datagrid cell, it opens a new pop up window showing the selected item details. I have already implemented all these steps. The datagrid initialisation follows:grid = new DataGrid(); grid.AutoGenerateColumns = false;grid.ItemCom...

.NET 1.1 Web Form
I am scratching my head trying to figure out why my events button (Lighting Bolt) is not displaying when I select buttons in Visual Studio 2003.  Has anybody had this happen before? I am tired into Visual Source Safe and wonder if that has anything to do with it?Moojjoo Õ¿Õ http://www.mmwebs.comhttp://moojjoo.blogspot.com/ Ummm>>>   That is the difference between C# and VB.NET.  VB.NET does not display the Lightning Bolt under properties in VS 2003.Moojjoo Õ¿Õ http://www.mmwebs.comhttp://moojjoo.blogspot.com/...

Event from ASA, how post a event to client
Do ASA have a mechanism of support client notification? In Interbase it's POST_EVENT. Oracle also have analogous a support. How in ASA? I want from Insert Trigger post to client a notificaton about of inserting record. ASA does not have any means of broadcastive events from the server back to the connected users. There are a couple of ways to accomplish this. The simplest way is create some sort of event log table and have your trigger write a row to the event log table when a row is inserted. It then becomes the client application responsibility to periodicly monitor th...

Web forms and events
 A design issue regarding web forms user interfaces has been bugging me for some time. It is an "order of events" issue, which good design should eliminate right.. but how? Lets say I have written a User Control which takes some input from the user. In order to encapsulate the User Control, I've created an event which the control fires when (if) the user has made some sort of change. The event tells other parties (ie. the parent page) both the fact that the user has done something, and event data tells us what they did.Now, I drop the User Control onto a page. The pag...

Post Back Event
Is there a way to identify the event that actually caused a page to be posted from withtin an HttpModule ? ...

Event handling web user control buttom in web form
How would I handle the button1 click event from a web user control on a web form in the codebehind? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("test") End Sub does not work. Button1 is in the web user control. How would one handle the event in the page the web user control is embedded in? nevermind. it all came down to the class declaration in the codebehind file for the user control. It was originally webusercontrol2 and I renamed the ascx file to datesel.ascx and it never changed t...

Adding Event Handlers for Events in Windows Forms
Hi, I'm getting confused by statements such as the one below.... any ideas? "Finally, add another event handler for the Closed event of the Browser.cs form and add this code:" I understand event handling and whatnot, but do I need to write my own event handling methods, or are they included somewhere? Regards, Neil Well, if you are in the Design view of your form then see in the properties window a lightning icon. If you press this icon you will see a list of available events.Sonu Kapoor [MVP] Feel free to ask me any .NET question | Ajax Data Controls Forum Ah, I se...

Could PB .NET Web Form POST security Information to others web page??
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi,=20 Have anyone came across the requesion to POST security informations from = PB .NET web form web page to other web site?? I have tried many datys, Could any kind man give me some suggessions?? thanks & Best regards Leon ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML P...

Web resources about - How to bypass onsubmit event when post back DDL event? - asp.net.web-forms

Blog archive - Splinter Software
Chris Hulbert, Splinter Software, is a freelance iOS developer based in Sydney, Australia.

Action-Guy Comics - Mercenary Art Studio Store
Home Achilleas Kokkinakis Action-Guy Comics Amazing Family..Guy Avengers Assembwhaaa? Buttman The Dark Guy Falls Civil Wha…? Fantastic Family ...

公司网络web服务器负载均衡解决方案
数据库子站,提供数据库管理软件优质技术信息的领先在线资源,是数据库管理员、开发人员和负责决策制定的 IT 经理人至关重要的社区。我们提供具有特色的、全面的内容,包括专家答疑、讨论论坛、白皮书、原创的行业新闻、评论分析以及技术技巧等。还有众多国内外数据库专家定期为我们的网友在线答疑,让我们的沟通学习更为方便。 ...

Asana · Luna
Luna is an in-house end-to-end framework that automates the busy work of writing rich web applications to an unprecedented degree

Email this page to a friend - B&H Photo Video Pro Audio
$(".emailItemToFriend").validate({ onsubmit: true, onfocusout: false, onkeyup: false, rules: { sendersEmailAddress: { required: true, email: ...


Clicks Today February 2013 Archives » Clicks Today
ClicksToday.com You are currently browsing the Clicks Today blog archives for February, 2013. About February 2014 January 2014 December 2013 ...

Home - :
Fast & Easy CopyDoodles are easy to use for any business, no matter what your system set up is. Guaranteed to Work We have a huge collection ...

Javascript Tutorials, Examples, and Code Reference
Javascript tutorials for website scripting and programming. Here you can learn about Javascript, see examples, and also find out which technologies ...

Entrepreneur Stories - Be Your Own Boss
action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com ...

Resources last updated: 12/8/2015 3:20:41 AM