Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

How to raise a server-side event asynchronously?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmet Gunes - 10 Apr 2008 16:06 GMT
Hello,

I am trying to develop my own AJAX Framework.
Actually this framework will allow field-based validation without using
Validation Controls.
For example, let's have a webform with 2 text boxes (txtFirstName,
txtLastName) and 2 dropdownlists (ddlCountryOfBirth, ddlCityOfBirth).
Let's assume that the tab order of these controls is txtFirstName,
txtLastName, ddlCountryofBirth, ddlCityOfBirth.
Each of these 4 controls have a server-side validation code in TextChanged
events of textboxes and SelectedIndexChanged events of dropdownlists.

Here is a simple scenario:
1. User enters his first name and clicks the TAB key.
2. An ajax request goes to server side and runs the associated TextChanged
event of txtFirstName.
3. If the first name is valid a success message is sent to client and the
cursor is placed in the txtLastName field, else an error message will be
shown to the user and the cursor will be placed into txtFirstName
4. Assuming first name is valid, user enters his last name
5. An ajax request goes to server side and runs the associated TextChanged
event of txtLastName.
6. If the last name is valid a success message is sent to client and the
cursor is placed in the ddlCountryOfBirth field, else an error message will
be shown to the user and the cursor will be placed into txtLastName
7. etc.

Please note that the web form will be designed like a normal web form.
But all requests to this web form, other than the very first request, should
only run the corresponding server-side event handler.

I have been studying the ASP.NET request pipeline for the last few days and
have learned about several interfaces (IHttpHandler, ICallbackEventHandler,
etc) and events (OnInit, OnInitCompleted, OnPreRender, OnRender, etc).
I wonder if anybody has a brilliant solution to this scenario...

Thanks in advance,

Ahmet Gunes, PMP, MCSD, MSF
bruce barker - 10 Apr 2008 20:22 GMT
for validation, I'd use a webservice. ajax is async, so while you can fire on
the tab, the call will not return before the tab goes to the next field. if
the user types fast, they can fill in two fields before the first validation
request returns.

-- bruce (sqlwork.com)

> Hello,
>
[quoted text clipped - 35 lines]
>
> Ahmet Gunes, PMP, MCSD, MSF

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.