为ontxtchanged事件添加值的逻辑. [英] Logic for adding value ontxtchanged event.

查看:77
本文介绍了为ontxtchanged事件添加值的逻辑.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Web应用程序,因为我有一个类文件cement_class.cs,因为我已经完成了所有方法的编码,并且属性了另一个类文件,因为我已经完成了与数据库有关的添加/更新/删除的编码使用存储过程,现在我有一个aspx页面和aspx.cs页面,它基本上与水泥信息相关,现在我有三个文本框:

1)没有水泥袋
2)每袋收费
3)金额

因此,如果没有袋数是x并且每袋率是y,那么我想直接在那个文本框中打印答案x * y,也许使用txtchange事件....
因此,逻辑应该是什么?在类文件或aspx.cs文件中,我必须在哪个文件上编写此逻辑?请尽可能让任何人给我这个想法……. .

谢谢……

I''m developing one web application in that i have one class file cement_class.cs in that i have done coding of all methods and property another class file in that i have done coding related to database for add/update/delete using store procedure now i have one aspx page and aspx.cs page it is basically related to cement information now i have three text boxes:

1) no of bags of cement
2)rate per bag
3)amount

So if no of bags is x and rate per bag is y so i want to directly print the answer x*y in that text box of amount perhaps using txtchange event....

so what should be the logic??and at which file i have to write this logic??in class file or aspx.cs file??please if possible anyone just give me idea for this...........

thanks...............

推荐答案

我猜你不知道ASP.NET.这是功课吗?您可以进行回发,但是我只需要在javascript中进行回发,这意味着它会出现在您的aspx文件中.
I guess you don''t know ASP.NET. This is homework ? You can do a postback, but I''d just do it in javascript, which means it goes in your aspx file.


aspx页面有什么作用?它仅显示数据库信息吗?
在这种情况下,为什么不只将存储过程更改为选择x,y,x * y为z"并绑定它?

如果用户输入文本,并且要进行回发评估,则可以将代码添加到TextBox的"onTextChanged"事件.
如果要评估而没有回发,请尝试使用jQuery或AJAX-Toolkit: http://www.asp.net/ajaxlibrary /act.ashx [ ^ ]
what does the aspx page do? does it only show database information?
in that case, why dont you just change your stored procedure to "select x, y, x*y as z" and bind it?

if the user inputs text and you want to evaluate with a postback, you can add code to the "onTextChanged" Event of the TextBox.
if you want to evaluate without a postback, try jQuery or the AJAX-Toolkit: http://www.asp.net/ajaxlibrary/act.ashx[^]


这篇关于为ontxtchanged事件添加值的逻辑.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆