简体   繁体   English

从页面后面的代码访问变量到aspx页面

[英]access variable from code behind page into aspx page

I am trying to access variable from code behind page into aspx page that is in HTML type. 我正在尝试从页面后面的代码访问HTML类型的aspx页面中的变量。 for that i am using the below code Note. 为此,我正在使用以下代码 I m binding StringBuilder stored it in a variable and I am trying to access that variable in my aspx page. 我将StringBuilder绑定到一个变量中,然后尝试在aspx页面中访问该变量。

<input type= "text" name="keyword" value = "<%=MyKeyword.ToString %>"/>

but it is showing Error like The name 'MyKeyword' does not exist in the current context I am also try to access through Javascript but showing same error. 但它显示错误,例如名称“ MyKeyword”在当前上下文中不存在,我也尝试通过Javascript访问但显示相同的错误。 can any body suggest what should i do? 有谁能建议我该怎么办?

声明MyKeyword具有公共访问权限或创建public属性。

public StringBuilder MyKeyword=new StringBuilder();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用javascript从页面后面的ASPX代码访问类 - Access a class from ASPX Code behind page using javascript 关于不在服务器上运行的.aspx页上的输入变量以及背后的代码 - Regarding an input variable on .aspx page which is not running on server and code behind 如何在后面的代码中访问另一个ASPX页面? - How can I reach an aspx page from another in code behind? 如何从后面的代码中调用.aspx页中的书面函数 - how to call a written function in .aspx page from code behind 从背后的代码动态创建aspx页面中的JavaScript块的一部分 - Dynamically create part of JavaScript block in aspx page from code behind 在背后的代码中通过函数调用传递客户端ID时,无法通过aspx页面上的javascript函数访问字段的值(页面加载) - Unable to access a field's value via javascript function on aspx page on passing client id from function call in code behind(page load) ASPX页面后面的代码未执行js代码 - code behind ASPX page is not executing js code 在按钮上,单击发送Ajax调用并从aspx.cs(后面的代码)获取值到aspx页面,并将其显示在同一页面的输入字段中 - On button click send Ajax call and get value from aspx.cs(code behind) to aspx page and display it in input field in the same page 我如何在aspx页面上显示变量值后面的代码 - How do I display the code behind variable value on my aspx page 从aspx页面调用代码隐藏方法的AJAX代码不起作用 - AJAX code for calling code-behind method from aspx page doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM