Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is the child page

XML
<asp:TextBox ID="TextBox1" runat="server" BackColor="Bisque" Width="125"
                OnTextChanged="fun()"></asp:TextBox>


XML
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" language="javascript">
        function fun()
       {
       alert('imran')
       }
        </script>
    <div id=" " style="height: 886px">



error is
VB
CS1061: 'ASP.addcategory_aspx' does not contain a definition for 'fun' and no extension method 'fun' accepting a first argument of type 'ASP.addcategory_aspx' could be found (are you missing a using directive or an assembly reference?)
Posted
Updated 1-Dec-11 20:13pm
v3

Apply onchange="fun()" instead of OnTextChanged="fun()"
Read the following link for TextBox.OnTextChanged Method
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.ontextchanged.aspx[^]
 
Share this answer
 
Comments
Prince Antony G 2-Dec-11 3:34am    
its is working..try this..my 5+
Monjurul Habib 2-Dec-11 3:34am    
thank you
Rubaba 3-Dec-11 11:43am    
nice answer.5*
Monjurul Habib 3-Dec-11 13:03pm    
thank you Rubaba.
Remove 'this' inside fun() method because the method does not contain any parameter. or do vice versa

XML
<asp:TextBox ID="TextBox1" runat="server" BackColor="Bisque" Width="125" onchange="javascript:fun()">


Please mark as answer and vote 5 if this solved your problem

Regards,
Eduard
 
Share this answer
 
v3
Comments
Prince Antony G 2-Dec-11 3:29am    
its not working..still error only comes
[no name] 2-Dec-11 3:35am    
how about <asp:TextBox ID="TextBox1" runat="server" BackColor="Bisque" Width="125" OnTextChanged="javascript:fun()">
Prince Antony G 2-Dec-11 3:39am    
its gives error
[no name] 2-Dec-11 3:49am    
i see. try solution 4 :P
Remove this in fun(this)
void is also not required remove it

Quote:
<asp:textbox id="TextBox1" runat="server" backcolor="Bisque" width="125" xmlns:asp="#unknown" OnTextChanged="fun()">
 
Share this answer
 
v2
Comments
Prince Antony G 2-Dec-11 3:31am    
xmlns:asp="#unknown" -- what it indicate
Abhi KA 2-Dec-11 3:39am    
remove that its not working

<asp:textbox id="TextBox1" runat="server" backcolor="Bisque" width="125" OnTextChanged="fun()">
Prince Antony G 2-Dec-11 3:42am    
<asp:TextBox ID="TextBox1" runat="server" backcolor="Bisque" Width="125" onchange="fun()">

it will work
Abhi KA 2-Dec-11 3:45am    
if worked perfectly upvoted 5
add this
OnTextChanged="fun()"


go thru this link
click
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900