在aspx页面的“网格视图"超链接列中访问变量背后的代码 [英] Accessing a code behind variable in the Grid View hyperlink column on aspx page

查看:68
本文介绍了在aspx页面的“网格视图"超链接列中访问变量背后的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用<%=CurrYear%>访问apsx页面中GridView的超链接模板列中后面代码中声明的当前年份变量.它不起作用.我只需要在后面的代码中处理这个问题吗?请告诉我.谢谢.

Hi, I am trying to access a current year variable declared in code behind from the hyperlink template column of GridView in apsx page with <%=CurrYear%>. It is not working. Do I have to handle this in code behind only? Please let me know. Thanks.

推荐答案

您的变量CurrYear应该是公共的或受保护的,只有您才能在aspx页面中访问它.
Your variable CurrYear should be public or protected then only you can access it in the aspx page.


谢谢.我将其作为公共变量.我可以在gridview外部访问它,但不能在内部访问它.
Thanks. I have it as a public variable. I am able to access it outside gridview but not inside.


这篇关于在aspx页面的“网格视图"超链接列中访问变量背后的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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