Reputation: 27
I am trying to access variable from code behind page into aspx page that is in HTML type. 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.
<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. can any body suggest what should i do?
Upvotes: 0
Views: 746
Reputation: 94653
Declare MyKeyword
with public access or create the public
property.
public StringBuilder MyKeyword=new StringBuilder();
Upvotes: 1