javascript - Call asp.net code-behind method when double clicked on html table -


i ask, if there way init asp placeholder , call code-behind method change placeholder content ?

double click event:

$('.testtr').dblclick(function () {    $('.testtr').not(this).toggleclass('hidden');    $(this).toggleclass('detail');    $('.details').toggleclass('hidden') }); 

and code-behind method:

protected void gettaskdetails(int id) {     sqlconnection conn = new sqlconnection();     conn.connectionstring = configurationmanager.connectionstrings["local"].connectionstring;     conn.open();     sqlcommand cmd = new sqlcommand();     cmd.commandtext = "select * tasks id = @id";     cmd.parameters.addwithvalue("@id", id);     sqldatareader reader = cmd.executereader();      var title = "";     var desc = "";       while (reader.read())     {         title = reader[1].tostring();         desc = reader[2].tostring();     }      stringbuilder sb = new stringbuilder();     sb.append("<table>");     sb.append("<tr>");     sb.append("ble ble</tr>");     sb.append("</table>");      taskdetails.controls.add(new literal { text = sb.tostring() }); } 

i've added placeholder aspx site. want show/init placeholder when double click on table row, should filled data gettaskdetails method. tried use oninit, guess it's not need. can me find way ?

edit:

i've created new div placeholder within it. how looks like:

<div class="details">           <asp:placeholder id="taskdetails" runat="server" oninit="taskdetails_init"></asp:placeholder> </div> 

.details have display:none property. now, when click twice on table row, div shows placeholder content, problem when i'm trying show table rows again (double click on table row hiding other rows, shows them if click again). content of placeholder stays , see below table. can clear somehow ?


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -