Click here to Skip to main content
11,409,532 members (51,476 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Oracle VB.NET
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()
{
alert("scr");

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

for( i=1;i<=vlue;i++)
{
alert(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="")
{
document.getElementById('txtpointer').focus();
document.getElementById('txtcolour').focus();
return false;

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

}
</script>
Posted 24-Feb-13 23:28pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Register javascript code from asp.net code behind.

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

Solution 1

<head></head>
<body >
<form id="Form1" runat="server">
</form>
</body>
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,731
1 OriginalGriff 6,895
2 Maciej Los 3,332
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2015
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