CodeBehind web control button结合前瑞javascript的方法

| | Comments (0)

Codebehind的情形之下,利用web form控件(HTML控件以服务器端执行不能run)在中的Attribute属性,可以和前端的javascript做结合,当我们新增一个Attribute属性,就代表着最后产生HTML code之后的一个属性或方法。
常常写程序会遇到double check的情形以增加程序上的正确性,可利用如下程序代码。

private void Page_Load(object sender, System.EventArgs e)
{
btnSubmit.Attributes.Add("onclick","javascript:return confirm('sure?');");
}

Leave a comment

About this Entry

This page contains a single entry by CcChen published on December 2, 2005 11:43 PM.

提振新奥尔良的强心针:全市免费无线网络 was the previous entry in this blog.

Yahoo!将根据浏览行为投放相关广告 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Google Ads