Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show popup window in “-ing” event receiver?

Status
Not open for further replies.

CollapseTroll

Programmer
Feb 27, 2012
2
0
0
MD
I created event receiver that uses web service, and I want to show the result on popup window.

I know we can use different kinds of redirect in synchronous receivers, but it is called by checkbox in filtered datasheet view, so I'm not able to make redirect back to my page.

So I need to show some popup window. I know we can get HttpContext object in constructor of event receiver, but now I don't know how to call javascript window?
 
So, is this the flow? A user checks a box in a row in a datasheet view and you want an OnEditing event receiver to call a web service. Based on the result of the web service, you want to display a popup.

You can call web services from javascript. You might consider a purely client-side approach to solving this.

buckenn, Thank You for Your response! Yes You ar eright here, it is my situation. More exact 'ItemUpdating' sharepoint event receiver. So I wanted to call javascript code from receiver. Unfortunately it is not completely possible. Item event receiver doesn't know anything about context, but we can get Context by a little 'hack' initializing it in constructor.

Then we can call something like that:

Context.Response.Write("<script type='text/javascript'>alert('This message is from event handler');</script>");
But this trick will only work in form views.

But for datasheet views I resolved my task on the other side - writing result message in Afterproperties, in "Log" field instead of javascript window. And datasheet view updates in online mode, no need refresh the page.

Sorry for my bad english :)

Best regards,Gennady

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top