Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I want to start a function in CodeBehind I read that I just need to add "asp:" so that the C# function is called and not the js but when I add asp to my code the add-in stops working
ASP.NET
<asp:TextBox ID="txt" runat="server" OnTextChanged="txt_OnTextChanged" ></asp:TextBox>

If I remove this "asp:textbox" my code works fine but when I add it the add-in don't even start.

What I have tried:

I tried alot of things like using ajax to send over values to codebehind but it don´t works who I want it to...
Can someone please help I have rely no idea what I am doing wrong... I want to access a method in code behind on change of the textbox.
Posted
Updated 10-May-16 9:50am
Comments
Member 12003400 10-May-16 9:57am    
Paste your whole code here.
Are you using updatepanel?
Sergey Alexandrovich Kryukov 10-May-16 9:58am    
Not clear. "Office" has nothing to do with ASP.NET.
—SA
Suvendu Shekhar Giri 10-May-16 10:00am    
Have you created the project using the Visual C# -- Office Add-ins template?
As @Sergey mentioned, it has nothing to do with ASP.Net.

Please check following link if it helps-
Walkthrough: Creating Your First VSTO Add-in for Word[^]

1 solution

You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.

The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]

Used the debugger on client and server sides and see where ir stops working and probably why.
 
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