I want to call a javascript function WITH parameters function from c#

I want to call a javascript function WITH parameters function from c#

Post by kike » Thu, 25 May 2006 01:47:48



I want to call a javascript function WITH parameters function from c#
code; I already did this:
....
StartDate.Attributes.Add("onTextChange","DateGreaterThan(" +
StartDate.Value + "," + RequiredByDate.Value + ");");
....
in the control (C# code)

What is the syntax to call the function from asp.net?
this does not work:
<combo:WebDateChooser id="StartDate" runat="server"
onValueChange="DateGreaterThan(Date2, Date1);"></combo:WebDateChooser>

this is the function in javascript:

function DateGreaterThan(Date2,Date1)
{ ....}

 
 
 

I want to call a javascript function WITH parameters function from c#

Post by Vinayak Chauha » Fri, 26 May 2006 01:29:42


Hello,

       here is the example to call a javascripton control's even

 <html>
<head>
<script language="javascript" ...>
fuction fun(txt)
{
      window.alert(txt.value);

Quote:}

</script>
-- here txt is the textbox

</head>
<body>
         <table cellpading=0 cellspacing=0>
         <tr>
              <td>
                   <asp:TextBox id="txtFrom" runat="server">
</asp:TextBox>
              </td>
              <td><img id="imgFrom" runat="server" OnClick="fun(txtFrom);"
         </tr>
         </table>
</body>
</html>


Quote:

> I want to call a javascript function WITH parameters function from c#
> code; I already did this:
> ....
> StartDate.Attributes.Add("onTextChange","DateGreaterThan(" +
> StartDate.Value + "," + RequiredByDate.Value + ");");
> ....
> in the control (C# code)

> What is the syntax to call the function from asp.net?
> this does not work:
> <combo:WebDateChooser id="StartDate" runat="server"
> onValueChange="DateGreaterThan(Date2, Date1);"></combo:WebDateChooser>

> this is the function in javascript:

> function DateGreaterThan(Date2,Date1)
> { ....}

--
Vinayak J. Chauhan