javascript - How to close a popup form after saving in asp.net and vb.net web application -
i new asp.net , vb.net.
i maintaining web application contains many users , information. list.aspx page if 1 clicks individual name list goes page called update_status.aspx contains info of particular user. page produces form can update info user clicking update button in form. after clicking update button saves update , redicets details.aspx page.
now update_status.aspx page converted popup page , renamed update_status_popup.aspx
now requirement close popup window after update when clicks update , dont redirect details.aspx page
how can that. webpage built asp.net , vb.net
i including codes below.
the next link opens popup window called update_status_popup.aspx
<a class="hover-glow" style="cursor:pointer;" data-placement="bottom" rel="tooltip" title="change status" data-bind="click: $parent.openpopup"><i class="icon icon-random"></i> </a>
in update_staus_popup.aspx code update button
<div class="btn-wrapper"> <button runat="server" id="btnupdate" class="btn" data-bind="enable: ((statusid() == 10 && offeredsalary() < 0) || (statusid() == 11 && finalsalary() < 0) || (feetype() == 2 && introductionfee() <= 0 && statusid() == 11 && agencyapp() == 'true')) ? false : true">update</button> <a class="btn" href="javascript:window.close();">close</a> </div>
there 2 button update , close. close button closes window client requires close form automatically after updating.
the nowadays vb.net code btnupdate follow
protected sub btnupdate_serverclick(sender object, e eventargs) handles btnupdate.serverclick if comnewstatus.items.count <= 0 response.redirect("details.aspx?i=" & request("i")) end if dim previusstatus = vacancyapplication.status, _ newstatus = cint(comnewstatus.value) if newstatus <> vacancyapplication.statusid seek if newstatus = 10 vacancyapplication.offeredsalary = ctype(txtofferedsalary.value, decimal) vacancyapplication.addnote("offered: " & txtofferedsalary.value) elseif newstatus = 11 vacancyapplication.addnote("final salary: " & txtfinalsalary.value) vacancy.finalsalary = cdec(txtfinalsalary.value) vacancy.save() if vacancy.feetype = 1 andalso cdec(txtfinalsalary.value) > 0 vacancy.calculatefees() vacancy.savefees() end if dim vh new vacancyhistory {.vacancyid = vacancyapplication.vacancyid, .description = "final salary added. amount:" & txtfinalsalary.value} vh.save() elseif newstatus = 12 vacancyapplication.startdate = cdate(txtstartdate.value) vacancyapplication.addnote("start date: " & txtstartdate.value) end if if vacancy.feetype = 2 andalso cdec(txtfinalintroductionfee.value) vacancy.setfinalintroductionfee(cdec(txtfinalintroductionfee.value)) dim vh new vacancyhistory {.vacancyid = vacancyapplication.vacancyid, .description = "introduction fee added per variable fee type. fee:" & txtfinalintroductionfee.value} vh.save() end if vacancyapplication.save() vacancyapplication.updatestatus(cint(comnewstatus.value), true, false) grab ex exception _logger.fatal(ex.message) response.redirect("/e4/error/500.aspx") end seek if not string.isnullorwhitespace(txtnote.value) vacancyapplication.addnote(txtnote.value.trim()) _logger.fatal("details.aspx?i=" & vacancyapplication.id & "&c=" & vacancyapplication.statusid) end if response.redirect("details.aspx?i=" & vacancyapplication.id & "&c=" & vacancyapplication.statusid) end sub end class
the above code redirects page details.aspx page (which opens in same popupup , not smart.). please suggest me code close update_status_popup.aspx page after saving details.
you can utilize registerclientscriptblock
page.clientscript.registerclientscriptblock(me.gettype(),"closewindowscript","window.close();",true)
use in place of response.redirect
; inject phone call window.close() when page reloads, causing window close.
javascript jquery asp.net vb.net knockout.js
No comments:
Post a Comment