Click here to Skip to main content
13,296,823 members (38,696 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have the following script i need to register into page load how can i register it?

<script language="javascript" id="script1" type="text/javascript">

function text_reason()

var vlue =document.getElementById('ddlst_Scale_pointers').value ;
//var myvalue ="Textmin" + 1;

for( i=1;i<=vlue;i++)
alert("Label VAL :" + document.getElementById('txtpointer').value);
var empt =document.getElementById('txtpointer').value;
alert("Color VAL :" + document.getElementById('txtcolour').value);
var empt1 =document.getElementById('txtcolour').value;

if( empt=="" or empt1="")
return false;

// myvalue ="Textmin" + (i+1);
// alert(myvalue );

Posted 24-Feb-13 23:28pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Register javascript code from code behind.

protected void Page_Load(object sender, EventArgs e)
     string js = "function test(){alert('hello')'}";
     ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "k1", js, true);
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100