Posts

c# - How to pass parent view data when using partial view -

i have dropdownlist in parent view , when select value want save value , use when click button in partial view. if click button in partial view not have value of parent view. however, if move dropdownlist partial view works fine, keep in parent view. parent view (this dropdownlist is) <div class="btn-toolbar"> <div class="btn-group"> <button type="button" class="btn btn-primary" id="fetchprocessid">fetch process id</button> </div> </div> <div class="col-md-3" style="@displayadminlead"> <div class="dropdown div-inline"> @{ var envlist = new list<selectlistitem>() { new selectlistitem() {value = "oak", text = "oak"}, new selectlistitem() {value = "qa", text = "qa"}, new selectlistitem() {value = "prod...

javascript - Get index of elements nested in different divs -

is possible index of checked input, of them nested in different divs. eg such situation: <div class="parent"> <div> <input></input> <input></input> <input></input> </div> <div> <input checked="checked"></input> <input></input> <input></input> </div> </div> so checked input show index = 3 how build such selector? possible? or can show index of children nested directly withing same parent? try invoke .index() on entire collection passing target element, var inputs = $(".parent input:checkbox"); var index = inputs.index(inputs.filter(":checked")); //3 demo a demonstration valid html given here .

c# - Hidden form not closing -

i have c# form , have form1 shown @ start, , when press go taken form2 . form1 hidden , form2 shown. now when exit form2 , whole application should closed. using application.exit() when press exit button. facing problems if user presses x or alt+f4 or rightclick->close . form close hidden form stay opened. how can fix that? when press 1 of these control button, hidden forms close? i tried form1_close , form1_closing function didn't seem work. try this: hide(); form2 form2 = new form2(); form2.closed += (s, args) => this.close(); form2.show(); this close form1 when close form2 . if user presses x or alt + f4 or rightclick -> close on form2 form2 , hidden form1 close.

Cannot deploy grails war in Tomcat 7 and Ubuntu - 404 error -

i've create simple grails 3 application test issue deploying tomcat on ubuntu server (digital ocean). to create app : grails create-app test to ensure tomcat not embedded in deployed war : provided "org.springframework.boot:spring-boot-starter-tomcat" to create war grails war i'm uploading , deploying war using tomcat application manager. the app manager reports application deployed. catalina.out reports finding app , explodes war. however, visiting http://ipaddress:8080/test results in 404 i've deployed sample war file (from tomcat 6) , sample app deploys without issue , can access on http://ipaddress:8080/sample so difference between grails (3) war , more typical war. deploying test war/app works on local installation of tomcat (mac os) not on ubuntu server. i've seen number of similar problems on issue none have provided working solution. one thing notice don't see (that in local environment) h2 database : proddb.h2.db...

javascript - Automapping ajax data during ajax put or post in knockout -

during ajax request, can use ko.mapping.fromjs data server , automapping. also, can use ko.mapping.tojs post or put ajax data server in knockout. however, assumption every value in ko.mapping.tojs pass in ajax call. use delete or ignore remove property should not pass server. recently, have came problem follow. how pass data want without explicitly assign or ignore data 1 one cumbersome. thinking restructuring view model may job not know how start. function myviewmodel() { var self = this; // these data should not pass in ajax call self.data1 = ko.observable(); self.data2 = ko.observable(); self.data3 = ko.observable(); ... self.data50 = ko.observable(); // these data should not pass in ajax call self.nodata1 = ko.observable(); ... self.nodata10 = ko.observable(); // these should not pass in ajax call self.function1 = function() { } self.function2 = function() { } self.function3 = function() { $.ajax({ ...

jquery - Ajax form with different actions in ASP MVC -

in asp.net mvc have following input form (simplified): <div id="ajaxtarget"> @using (ajax.beginform("submitform", "home", new ajaxoptions { updatetargetid = "ajaxtarget" })) { @html.dropdownlistfor(x => x.postalcode, model.postalcodeitemlist, new { @name = "postalcodeid" , @id="postalcodeid" }) @html.labelfor(x => x.streetcode) @html.dropdownlistfor(x => x.streetcode, model.streetitemlist, new { @id="streetcodeid" }) ... <input type="submit" value="@global.execute" id="btnsubmit" /> } </div> when user selects first dropdownlist, second dropdownlist should populated via ajax. can send 'call' controller via javascript update view: $(document).ready(function () { $('#postalcodeid').on('change', function () { $(this).parents('form').submit(); }); });...

javascript - no element error on ajaxing to php file -

i'm trying connect javascript , php files , no element error , couldn't figure out. in advance! +anyone can recommend ways debug these..? <html> <head> <title>ajax!!!!</title> <meta charset="utf-8"/> <link href="main.css" rel="stylesheet" type="text/css"/> </head> <body> <h1>home</h1> <h4>enter id</h4> <p>summoners name: <input type="text" id="summonername"></p> <button id="sumname">search!</button> <button id="renewdata"> renew data</button> <button id="testing"> renew data</button> <div id="result">display result</div> <script src="jquery/jquery.js"></script> <script type = "text/javascript"> $(document).ready(function(){ $('#testing').on('click', function(){ $.ajax...