how to use javascript to control the usercotrol in the asp.net
2010-09-19 15:26
721 查看
//test.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onclick", "checkt2();");
TextBox2.Attributes.Add("onclick", "checkt1();");
}
//javascript
<script language="javascript">
function checkt2()
{
if(document.getElementById("TextBox2").value!="")
{
document.getElementById("TextBox2").value="";
}
}
function checkt1()
{
if(document.getElementById("TextBox1").value!="")
{
document.getElementById("TextBox1").value="";
}
}
</script>
相关文章推荐
- How to use ValidationSummary control in asp.net
- (转)How to use the ASP.NET MVC ModelBinder
- [导入]Thow to use the AspnetUpload control 2.1(2)
- How to set the DefaultButton in a Page Based on ASP.NET Master Page
- How to use Console.WriteLine in ASP.Net (C#) during debug?
- FW: How to spawn a process that runs under the context of the impersonated user in Microsoft ASP.NET pages
- How to Choose the Best Way to Pass Multiple Models in ASP.NET MVC
- How to spawn a process that runs under the context of the impersonated user in Microsoft ASP.NET pages
- How to use AspnetUpload™ in your web application
- How to achive the CRUD in ASP.NET MVC(VS2010)
- [Windows Azure] How to use the Windows Azure Blob Storage Service in .NET
- [转]How to use an Area in ASP.NET Core
- How to use HTML-5 data-* attributes in ASP.NET MVC
- How to get the Current Controller Name, Action, or ID in ASP.NET MVC
- How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings
- How to Pop Open an image window that resizes to fit the image in ASP.net 1.x and 2.0 Beta 1
- How to use .NET Windows Control into the WPF Application
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- How to use FtpWebRequest in asp.net