c# - How to run two different events with separated PostBacks on Button Click -
i have button code:
protected void button1_click(object sender, eventargs e) { label1.text = "searching services"; updatepanel1.update(); }
but in add-on need show when find services add together event:
button1.click += (s, k) => { discovery.findalreadyregisteredservices(); discovery.discoveryclient.findcompleted += foundevent; auto[1].waitone(); updatepanel1.update(); };
which slow (and controlled autoresetevent)
protected void foundevent(object sender, findcompletedeventargs e) { label1.text = "found " + ((discovery.endpoints.count > 0) ? discovery.endpoints[0].address.tostring() : "nothing"); auto[1].set(); }
the problem button1.click += (s, k) =>
makes no sense @ because executes after button1_click
, there no postback
until bonded events finished?
i know can utilize want right on client using updateprogress
, javascript
want here client sent 2 events , wait 2 answers, create 2 postbacks. possible?
i know can utilize want right on client using updateprogress , javascript want here client sent 2 events , wait 2 answers, create 2 postbacks.
why? seems arbitrary constraint that's making otherwise trivial task unnecessarily complicated.
c# asp.net .net
No comments:
Post a Comment