c# - To get total marks into a textbox -
my code is:
protected void txttotal_textchanged(object sender, eventargs e) { int = convert.toint32(txtmaths.text); int b = convert.toint32(txtsci.text); int c = convert.toint32(txtenglish.text); int tot = + b + c; txttotal.text = convert.tostring(tot); }
i trying total marks textbox, not working.can me please?
you trying change text in same textbox text changing, sure want do?
wouldn't want change total when maths,sci , english values change? if @ following.
protected void txtmaths_textchanged(object sender, eventargs e) { updatetotals(); } protected void txtsci_textchanged(object sender, eventargs e) { updatetotals(); } protected void txtenglish_textchanged(object sender, eventargs e) { updatetotals(); } protected void updatetotals() { int = convert.toint32(txtmaths.text); int b = convert.toint32(txtsci.text); int c = convert.toint32(txtenglish.text); int tot = + b + c; txttotal.text = tot.tostring(); }
Comments
Post a Comment