473,569 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code for calling a button event (click) ? (asp.net 2)

moi
Hello,
i would like a sample code to call a button click with the event
"textchange d" of a textbox.
I just would like to valide a textbox with the textchanged event and not to
click on the submit button ...
Thanks for your sample ..

Bye !
Mar 8 '06 #1
2 1451
Double click the textbox in designer, which will create the following event in your codebehind:

Private Sub TextBox1_TextCh anged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles TextBox1.TextCh anged

' Add your validation here

End Sub

I assume you are already aware of the client side validation controls?
Sonu Kapoor - [MVP]
W: http://www.DotNetSlackers.com
B: http://www.Kapoorsolutions.com/blog/
---
Posted via www.DotNetSlackers.com
Mar 8 '06 #2
DWS
Moi,
Private Sub TextBox1_TextCh anged(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles TextBox1.TextCh anged
button1_click(s ender,e)
End Sub

Good Luck
DWS
"moi" wrote:
Hello,
i would like a sample code to call a button click with the event
"textchange d" of a textbox.
I just would like to valide a textbox with the textchanged event and not to
click on the submit button ...
Thanks for your sample ..

Bye !

Mar 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6180
by: CW | last post by:
In my javascript, when enter key is pressed, I want to simulate the effect of clicking a button. var mykey; var posted=false; if (window.Event){ document.captureEvents(Event.KEYDOWN); }
2
2023
by: Mike | last post by:
I have an ASP.NET webform that has an HTML button (with an onClick event that calls a javascript function) and a Web Forms button (the code behind click event saves data back to a SQL DB). The javascript function basically creates a variable such as: var someStrings = "foo1.jpg,foo2.jpg,foo3.jpg,foo4.jpg" I really need to be able to...
3
1273
by: Lachlan Gemmell | last post by:
Hello there, I'm hoping this is possible but as yet I haven't been able to find out how to do it. I have placed a client side VBScript function in the HTML of my ASP.NET page. Only under certain circumstances I want a server side button click event handler in my code behind class to trigger a call of that VBScript function. I understand...
4
3383
by: Ryan Ternier | last post by:
I have a button event: Public Sub SwitchItem(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim btnTest As New Button Dim astrTest As String() btnTest = CType(sender, Button) astrTest = btnTest.ClientID.Split("_") strControlsToEdit = astrTest(2)
7
3623
by: | last post by:
I am having trouble figuring out to call a database INSERT procedure from a simple submit form. It appears I should use the onclick event to trigger the procedure called BUT when I do this I receive this error: 'btnInsert_Click' is not a member of 'ASP.Insert_aspx'. I realise the procedure is houwsed in a sub which may be what is...
1
1792
by: Klaus Jensen | last post by:
Hi! This has been annoying me all day, and I can't get it to work It is really driving me nuts! Basicly this simple webapp created to illustrate my problem, renders five buttons, and adds a handler to the click event. When a button is clicked, the background-color is set to blue. Try running the page, and clicking the "Do stuff and...
12
7064
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to raise an event instead of just calling the sub? Scenario1 -- Using Events ------------------------------------------------------ Public Class...
21
8125
by: Ben | last post by:
Hello I have frames set up in an asp.net application and need one frame to refresh another. Seeing as events need to be registered at the time the page is sent from the server, I was wondering if I could place a hidden button in a frame that would have the attribute to refresh the other. I would need code to "invoke" the onclick event (ie...
4
5498
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't call a form's submit. I've found how to post programatically, but I need to use the form's target attribute so that the response goes into another...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.