CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/12/2004 10:42:37 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 38 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
kamran222
Asp.Net User
Stoping Page post through Javascript.1/12/2004 10:42:37 PM

0/0

Hi,
Is it possible to stop a page post through a javascript from a webserver control ?
I can spit out the javascript on the page. so if anyone out there knows how to stop the page post. It'll be great,

Thanks.
Bizzy10510
Asp.Net User
Re: Stoping Page post through Javascript.1/13/2004 3:28:41 AM

0/0

For the control that gets clicked (like a button being clikced) to submit it, add an onClick attribute that calls a javascript function. If that function returns false, the submit will not take place. For example, if your button renders like this:

<input type="submit" text="Submit" onClick="javascript:return DoThis();"/>

And your script function returns false:

function DoThis(){
return false;
}

Then the submit will never take place.
Joel
kamran222
Asp.Net User
Re: Stoping Page post through Javascript.1/13/2004 6:10:45 AM

0/0

This worked.. great help thanks so much...

One more thing i wanted to ask, I'll be thankfull to receive a reply on that .

Is it possible to call a vb.net sub from javascript ????

like this javascript code that Bizzy posted i want to use this script as a validation or something and if the validation goes true i want to call a sub FROM javascript...

Please let me know if it is possible and how can i achieve this functionality...

Thanks again for the reply...

master4eva
Asp.Net User
Re: Stoping Page post through Javascript.1/13/2004 7:42:55 AM

0/0

No, it is not possible directly. You will have to do some client-server events as described in my article over here:

http://aspalliance.com/articleViewer.aspx?aId=345&pId=5

The only customization that will have to occur is that on your protected method that is associated with the event, it will look something like this:

public event EventHandler MyEvent;

protected virtual void OnMyEvent(EventArgs e) {
if (Page.IsValid) {
if (MyEvent != null)
MyEvent(this, e);
}
}

-- Justin Lovell
kamran222
Asp.Net User
Re: Stoping Page post through Javascript.1/13/2004 9:33:09 AM

0/0

This pagepost code is for and html control, is it possible to apply this type of thing on the asp.net button ???
master4eva
Asp.Net User
Re: Stoping Page post through Javascript.1/13/2004 11:05:15 AM

0/0

Yes, it is possible:

public class MyButton : Button {
protected override void OnClick(EventArgs e) {
if (Page.IsValid) base.OnClick(e);
}
}

-- Justin Lovell
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Ajax and REST Recipes: A Problem-Solution Approach Authors: Christian Gross, Pages: 345, Published: 2006
Rails Cookbook Authors: Rob Orsini, Pages: 514, Published: 2007
Securing Ajax Applications: Ensuring the Safety of the Dynamic Web Authors: Christopher Wells, Pages: 233, Published: 2007
Programming Python: Object-Oriented Scripting Authors: Mark Lutz, Pages: 1255, Published: 2001
JavaScript Goodies: More than 250,000 people have learned JavaScript from Joe Burns and his HTML Goodies Web site! Authors: Joe Burns, Andree Growney, Pages: 356, Published: 1999
Essential ActionScript 3.0 Authors: Colin Moock, Pages: 911, Published: 2007
Windows XP Hacks Authors: Preston Gralla, Safari Tech Books Online, Pages: 548, Published: 2005
Essential SharePoint 2007: A Practical Guide for Users, Administrators and Developers Authors: Jeff Webb, Pages: 428, Published: 2007
Professional JavaScript for Web Developers Authors: Nicholas C. Zakas, Pages: 0, Published: 2005

Web:
Ned Batchelder: Stopping spambots with hashes and honeypots Negative CAPTCHA, Damien's post about a similar technique. .... On my guestbook form page I set a cookie using javascript then retrieve the cookie during ...
Using Apache to stop bad robots | evolt.org Using Javascript probably isn't the best way to go for a couple reasons. .... I put together this page describing the methods I use to stop bad robots, ...
Aptana Forums :: View topic - Problem stopping at breakpoints in ... Posted: Sun Jul 15, 2007 4:24 pm Post subject: Problem stopping at breakpoints in Javascript with plugin, Reply with quote ...
Stopping page from moving back to top - Prototype & script.aculo ... Oct 27, 2008 ... Im having this page with tabs in another page but added through php. ... try javascript:void(); in place of javascript:return false; ...
WordPress.com, Please Stop Using Snap Preview « Lorelle on WordPress I’m reading through a page, I scroll down and the mouse randomly ends up .... Then I will click it so fast, the javascript doesn’t have time to load and ...
JavaScript: Preventing user from leaving page - GameDev.Net ... Even though it is impossible to keep the current page through the onunload event , what is stopping you from submitting the form for the user ...
Page 4: Stopping an Event - Eight Weeks of Prototype: Week 4 ... Page 4 Stopping an Event One of the most useful and important aspects of JavaScript developments is that of event handling.
LexiConn News :: View topic - Restricting Shipping Options in ... Posted: Mon Jun 02, 2008 1:28 pm Post subject: Restricting Shipping Options in ShopSite using JavaScript, Reply with quote ...
stopping default action using "return false" not recommended ... Originally Posted by winterheat View Post. i think conventional usage of Javascript is to use "return false" to stop the default action, be it a form for ...
How to disable back button and backspace using Javascript ... You still can't stop the user pressing backspace, or having some registered shortcut .... Using Back Button Refreshes Page (Web Browsers) ...

Videos:
EbaY HACKED! Floating Javascript ~ Exodus Please read this text accompaniment Here we have an example of the floating javascript exploit which the hackers are using on ebay. address markusp...
Customer Centric Web Decision Making Google TechTalks July 24, 2006 Avinash Kaushik, Senior Manger, Web Research and Analytics, Intuit




Search This Site:










system.web.ui.webcontrols classes

loadcontrol(usercontrols/info.ascx) error, but i don't know the reason! please help chinese friend!

hosting managed desktops

exposing an internal dataset to the designer

little (very) help please

dynamically created controls and viewstate in a composite control

event bubbling & dropdownlist

book question

control ids in control tree

hosting with multiple ftp accounts?

introducing community.net - free hosting for good causes

this is a hard one having to do with viewstate and cache

querystring and templates

viewstate issue within metabuilders masterpages

sorting not working correctly

windows update

column 'invariantname' is constrained to be unique

problems with user controls

adding property

recommendations for ve/vps/semi/dedicated

dragging controls in to a custom control at design time

minimal code to create a hierarchicaldataboundcontrol

repeater

searching for windows hosting reseller for chile

datepicker control from mspress

cheap web hosting

property question

library of composite controls for sale or download?

server control calls web service with authentication

how to pass values from .ascx control to aspx.cs page

  Privacy | Contact Us
All Times Are GMT