views:

120

answers:

2

Is it possible to call the inserted event of formview in asp.net? from jquery for example:

$ ('#FormView1').Inserted (function () (/ / code ....

how do it???

A: 

Not really.
FormView is a server-side object with server-side events - they are written in C# (or other .net language), and run on your server.
jQuery is a JavaScript framework - it runs on people's browsers.

It is possible to expose the functionality to AJAX calls as long as you're only updating the database. If the ItemInserted event is changing the page in any way, you'll have to rewrite it in jQuery. You will also experience problems with the ViewState once you do post the page back, so you may want to disable it (or your data will appear outdated when you post back). Either way, it isn't a quick fix as you might expected. Sorry.

Kobi
A: 

Hi Kobi, thanks for answer, but I send information after the event inserted in an asp.net silverlight control, because my problem is that the silverlight control is closed just before the call to the function in jquery therefore can not receive that information that is sent.

mlho