如果“ASP:textbox”,则Office加载项将停止工作用来 [英] Office add-in stops working if "ASP:textbox" is used

查看:103
本文介绍了如果“ASP:textbox”,则Office加载项将停止工作用来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在CodeBehind中启动一个函数我读到我只需要添加asp:以便调用C#函数而不是js但是当我将asp添加到我的代码时,加载项会停止工作

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:TextBox ID="txt" runat="server" OnTextChanged="txt_OnTextChanged" ></asp:TextBox>



如果我删除这个asp:textbox我的代码工作正常但是当我添加它时,加载项甚至没有启动。



什么我试过了:



我尝试了很多东西,比如使用ajax将值传递给代码隐藏,但它不适用于我想要它。 ..

有人可以请帮助我不知道我做错了什么...我想在更改文本框时访问代码中的方法。


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.

推荐答案

您应该学习尽快使用调试器。而不是猜测你的代码在做什么,现在是时候看到你的代码执行并确保它完成你期望的。



调试器允许你跟踪执行逐行检查变量,你会看到它有一个停止做你期望的点。

调试器 - 维基百科,免费的百科全书 [ ^ ]

掌握Visual Studio 2010中的调试 - A初学者指南 [ ^ ]



在客户端和服务器端使用调试器,看看ir停止工作的原因以及可能原因。
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.


这篇关于如果“ASP:textbox”,则Office加载项将停止工作用来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆