473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

event chain in asp.net

Im interested in knowning how the web control event gets passed to
server and how its processed there.

Like how the click event of a web control button gets called for example

any sort of e-resource that would explain that?

*** Sent via Developersdex http://www.developersdex.com ***
Jul 20 '08 #1
2 2037
its really pretty simple.

a control that fires a server click has javascript code that does a
postback (the browser posts all form data) to the server. the exception
is the imagebutton and button which do not require any javascript unless
they are performing validation. the javascript places the name of the
control (and the cmdarg value) in a hidden field before the postback.

the serverside code processes the postback, after page load, it checks
for a control name in the hidden field, it then looks for a control with
that name. if the control implements, IPostBackEventHandler, it calls
RaisePostBackEvent, which is where the control decides what type of
event to raise. Normally the server control will define an event
delegate and call it.

there is a simular approach for postback data handling. the control
implements an inteface (IPostBackDataHandler), is is called with the
postback data, update its self and returns a flag if any data change
events need calling. the page processor will call the handler and the
control will raise the event.

a browser page postback consists of a named value collection of all
browser form fields (<input>, <selectand <textarea>) contained in the
<formdoing the submit. the format is pretty simple:

<fieldname1>=<fieldvalue1>&<fieldname2>=<fieldvalu e2>&

the names and values are urlencoded to handle imbedded special characters.

a browser submit button or image button will add itself to the list if
clicked (the image button actually sends a x and a y value via
buttonname_x and buttonname_y). this is how the server tells if one of
them caused the postback.
-- bruce (sqlwork.com)

Paul F wrote:
Im interested in knowning how the web control event gets passed to
server and how its processed there.

Like how the click event of a web control button gets called for example

any sort of e-resource that would explain that?

*** Sent via Developersdex http://www.developersdex.com ***
Jul 20 '08 #3

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

Similar topics

0
by: rodrigo | last post by:
I have a Asp.net table control that I dynamically add rows from a SQL database. Inside the table, I add radiobuttons and they all have different ID numbers according to BindChain() Looking In...
10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
9
by: mike | last post by:
I have this script executing <script> function mike_test(event) { x = window.event.clientX; alert(x); } </script> <iframe src="blank.html" id="my_iframe1"> </iframe>
15
by: prabhdeep | last post by:
Hi, Can somebody explain, why in following code, i get "event not defined" error funcTest(sMenu) { doument.getElementById('id1').addEventListener('mousedown', function(){ click(sMenu,...
17
by: dan_williams | last post by:
I have the following test web page:- <html> <head><title>Test</title> <script language="Javascript"> <!-- function fnTR() { alert("TR"); }
14
by: Snor | last post by:
I'm attempting to create a lobby & game server for a multiplayer game, and have hit a problem early on with the server design. I am stuck between using a threaded server, and using an event driven...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
5
by: steve.chambers | last post by:
I'm sure this q must have been asked before but I'm really struggling to find the answer anywhere so have finally given up and will consult the usenet community - hopefully there's someone out...
6
by: TriFuFoos | last post by:
Hi there, I was wondering if anyone knew if/how to assign an event to a global variable? I tried to do it and IE 7 came back with an error saying "Member not found" My code looked similar to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...

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.