[英]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.