Thursday 15 September 2011

asp.net - InnerHtml in c# -



asp.net - InnerHtml in c# -

i have <td id="statuspreview" runat="server"></td> , gets populated js function by:

document.getelementbyid('statuspreview').innerhtml = ext.getcmp('tycomboedit').getrawvalue();

now, alter content of td in c# when button clicked.

i created next method:

protected void hiddentoggletofrenchbackend(object sender, directeventargs e) { this.statuspreview.innerhtml = "aaaaa"; }

it not alter content on td. however, if place alert after setting innerhtml alerts aaaaa though td content has not changed reflect this. if place alert before setting innerhtml alert blank.

how can alter innerhtml of div?

thank you!

update:

if alter html <td id="statuspreview" runat="server">q</td> alert shows q if placed before setting innerhtml, , switches aaaaa if placed after. if innerhtml taking value on pageload, not current value.

to update asp.net command during directevent, should phone call .update() method.

protected void hiddentoggletofrenchbackend(object sender, directeventargs e) { this.statuspreview.innerhtml = "aaaaa"; this.statuspreview.update(); }

c# asp.net ext.net

No comments:

Post a Comment