Hi,
I have sample javascript function it have 2 parameter values. so how to access this script fuction in asp.net,c#.
Having javascript is:
<script language="javascript" type="text/javascript">
function splitLine(st,n)
{
var b = '';
var s = st;
while (s.length > n)
{
var c = s.substring(0,n);
var d = c.lastIndexOf(' ');
var e =c.lastIndexOf('\n');
if (e != -1) d = e;
if (d == -1) d = n;
b += c.substring(0,d) + '\n';
s = s.substring(d+1);
}
return b+s;
}
</script>
So how to use this script inside asp.net,c# and also how to pass values to this parameter.
Thanks.
Call javascript function in asp.net,c#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Bechir BejaouiRank #144 · 15.9K pointsPosted Mar 27, 2009, 2:12 AM EDT
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted Mar 27, 2009, 6:48 AM EDT
Or You can try this also:
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "SplitLine('" + arg1 +"' +","+ '"+ agr2 +"');", true);