asked on
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="_test2" %>
<form runat="server" name="form1">
<SELECT multiple size="7" name="testCategory" >
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</SELECT>
<asp:Button id="testbtn" runat="server" text="test call" />
<SELECT CLASS="AdHoc_Form_RIGHT" multiple size=17 name=mainlist></SELECT>
</form>
<SCRIPT>
function testfuntion() {
alert("here");
}
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class _test2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void testbtn_Click(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(GetType(), "javascript", "javascript:testfunction();", true);
//scriptManager.RegisterClientScriptBlock(this, GetType(), "hello", "testfunction);", true);
}
}
<INPUT onclick="AddListElements(this.form,this.form.testCategory)" type=button value=">>">