提交按钮 [英] Submit Button
问题描述
我有一个带有一些文本字段的web表单,一些validataion和一个提交
按钮。
当我点击提交位时,服务器端事件会不开火?????
为什么!!!!我尝试过更改EnableViewState我试过删除
CausesValidataion。
我使用的是VisualStudio 2003 / .net 1.1
< ; asp:Button id =" submit" RUNAT = QUOT;服务器"文本= [更新" EnableViewState =" True"
CausesValidation =" true">< / asp:Button>
private void InitializeComponent()
{
this.submit.Click + = new System.EventHandler(this.submit_Click);
this.Load + = new System.EventHandler(this.Page_Load); < br $>
}
#endregion
private void submit_Click(object sender,System.EventArgs e)
{
Response.Write(这是点击的按钮);
//在此更新用户文件
userRec.Replace(txtName.Text, 14,0,0);
userRec.Replace(txtEmail.Text,13,0,0);
userRec.Replace(txtFax.Text,21,0, 0);
userRec.Replace(txtVoice.Text,19,0,0);
tblEUsers.Write(userId,userRec);
if(txtPass.Text!="")//保存密码
{
}
}
Kevin Bilbee
I have a web form with a few text fields some validataion and a submit
button.
When I click the submit bittin the serverside event does not fire?????
Why!!!! I have tried Changing the EnableViewState I have tried removing
CausesValidataion.
I am using VisualStudio 2003/.net 1.1
<asp:Button id="submit" runat="server" Text="Update" EnableViewState="True"
CausesValidation="true"></asp:Button>
private void InitializeComponent()
{
this.submit.Click += new System.EventHandler(this.submit_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void submit_Click(object sender, System.EventArgs e)
{
Response.Write("This is the button clicked");
// Update the users file here
userRec.Replace(txtName.Text,14,0,0);
userRec.Replace(txtEmail.Text,13,0,0);
userRec.Replace(txtFax.Text,21,0,0);
userRec.Replace(txtVoice.Text,19,0,0);
tblEUsers.Write(userId,userRec);
if (txtPass.Text != "") // save the password
{
}
}
Kevin Bilbee
推荐答案
属性Page.IsValid是什么样的res验证事件。你必须
在某处查看你的页面。
" Kevin Bilbee" < kb的***** @ standardabrasives.com>在消息中写道
news:O
the property Page.IsValid is what fires the validation event. you must
check in you page somewhere.
"Kevin Bilbee" <kb*****@standardabrasives.com> wrote in message
news:O
************** @ TK2MSFTNGP12.phx.gbl ...
**************@TK2MSFTNGP12.phx.gbl...
我有一个带有几个文本字段的web表单,一些validataion和一个提交
按钮。
当我点击提交bittin时,服务器端事件不会触发??? ??
为什么!!!!我尝试过更改EnableViewState我尝试删除
CausesValidataion。
我正在使用VisualStudio 2003 / .net 1.1
< asp:Button id =" submit" RUNAT = QUOT;服务器"文本= [更新"
EnableViewState =" True" CausesValidation =" true">< / asp:Button>
private void InitializeComponent()
{
this.submit.Click + = new System.EventHandler(this .submit_Click);
this.Load + = new System.EventHandler(this.Page_Load);
}
#endregion
private void submit_Click(object sender,System.EventArgs e)
; Response.Write(这是点击的按钮);
//在这里更新用户文件
userRec.Replace(txtName.Text,14,0, 0);
userRec.Replace(txtEmail.Text,13,0,0);
userRec.Replace(txtFax.Text,21,0,0);
userRec.Replace(txtVoice) .Text,19,0,0);
tblEUsers.Write(userId,userRec);
if(txtPass.Text!="")//保存密码
{
}
Kevin Bilbee
I have a web form with a few text fields some validataion and a submit
button.
When I click the submit bittin the serverside event does not fire?????
Why!!!! I have tried Changing the EnableViewState I have tried removing
CausesValidataion.
I am using VisualStudio 2003/.net 1.1
<asp:Button id="submit" runat="server" Text="Update" EnableViewState="True" CausesValidation="true"></asp:Button>
private void InitializeComponent()
{
this.submit.Click += new System.EventHandler(this.submit_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void submit_Click(object sender, System.EventArgs e)
{
Response.Write("This is the button clicked");
// Update the users file here
userRec.Replace(txtName.Text,14,0,0);
userRec.Replace(txtEmail.Text,13,0,0);
userRec.Replace(txtFax.Text,21,0,0);
userRec.Replace(txtVoice.Text,19,0,0);
tblEUsers.Write(userId,userRec);
if (txtPass.Text != "") // save the password
{
}
}
Kevin Bilbee
这篇关于提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!