TextBox
两个TextBox相乘,将结果放在令一个Enabled为false TextBox3中,怎么将这个TextBox3中的值提取出来. --------------------编程问答-------------------- TextBox3.Text拿不出来?干嘛Enaled为false,为何不设置readOnly为true? --------------------编程问答-------------------- <asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server" Enabled="false"> </asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" />
protected void Button1_Click ( object sender, EventArgs e )
{
int result = Convert.ToInt32(TextBox1.Text) + Convert.ToInt32(TextBox2.Text);
TextBox3.Text = result.ToString ();
}
protected void Button2_Click ( object sender, EventArgs e )
{
Response.Write ( TextBox3.Text );
} --------------------编程问答-------------------- textbox3.text=(double)textbox1.text*(double)textbox2.text; --------------------编程问答--------------------
我是用javascript做的相乘,然后保存到 TextBox7中,可是我想把TextBox7的值存到数据库中,可是值我提不出来!!
<script type="text/javascript">
function ride()
{
var a=document.getElementById("TextBox5");
var b=document.getElementById("TextBox6");
var c=document.getElementById("TextBox7");
if(a.value=="" | b.value=="")
{
alert("数量和单价都不能为空!!");
return false;
}
c.value=a.value * b.value
}
</script> --------------------编程问答-------------------- csdn的缓存真垃圾 --------------------编程问答-------------------- 既然要用.net,何必用脚本做呢
强烈建议用后台代码来写
<asp:TextBox ID="TextBox1" runat="server">text</asp:TextBox>
这种控件最好别用js来控制....
补充:.NET技术 , ASP.NET