asp.net - Populate jQuery modal dialog form -


i have application contains gridview. when user selects 1 of items gridview, want able show jquery dialog box contains form pre-filled information selected item gridview. right have div html text boxes set modal dialog box. user clicks on it, , selected item's id retrieve. problem comes when want go out database, of details, pre-fill in of textboxes , other elements before displaying dialog box user.

an easy comparison having user click on item can submit form processed of items selection filled in. wondering easiest way go is. right have selecting item gridview uses jquery ajax post id [webmethod] in code behind can go off database , details of record. problem obvious reasons webmethod can't magically fill in fields of form. send of information ajax query fill in, feels pretty messy because there no real strong connection random data send , field belong to.

a lot of pondering out loud, interested in better understanding how use jquery , ajax within asp.net.

thank , input.

add attribute on gridview button:

  btn.attributes.add("onclick","showdialog();"); 

client script

 function showdialog(){       //setup dialog $('#dialog).setup(function(){    ......,    buttons: "ok", function(){      //save calling btn2.click() btn2 hidden button handles save logic in server side }); });       $('#dialog').show();     return false;     }); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -