Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

asp.net - Asp.net验证和控件(Asp.net Validations and controls)

how to disable the (Required attribute) in Text box in ASP.NET web forms I want to change the web form page to another one when I click on the Login button but I cant!

(如何在ASP.NET Web表单的文本框中禁用(必填属性)我想在单击“登录”按钮时将Web表单页面更改为另一页面,但是我不能!)

please help!

(请帮忙!)

  ask by Myaya translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For Disable Validation :

(对于禁用验证:)

<asp:TextBox id="txt" runat="server"  causesvalidation="false" />  // or reqiured=false

For Redirect :

(对于重定向:)

protected void btnConfirm_Click(object sender, EventArgs e)
{
Response.Redirect("YourPage.aspx");
//or
Server.Transfer("YourPage.aspx");
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...