本文介绍了repeater findcontrol System.NullReferenceException:对象引用未设置为对象的实例。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 人们, 我正在摸索一些可能相当简单的事情,但我现在整整一天心理障碍和需要帮助! 这里代码: Dim CurrentCat As String = RptAllCatsTest.FindControl(e.CommandArgument ).ToString() Session( CurrentCat)= CurrentCat CurrentCat = CurrentCat.Replace( , ) CurrentCat = CurrentCat.Replace( &, - ) CurrentCat = CurrentCat。替换( ,, - ) Response.Redirect( 〜/ Adverts / SearchCategory.aspx?Cat =& CurrentCat) 和错误信息,我在上面代码的第一行得到: 对象引用未设置为对象的实例。解决方案 Hi People,I am scratching my head over something which is probably fairly straightforward, but I'm now for a full day with a mental block and need help!Here the code:Dim CurrentCat As String = RptAllCatsTest.FindControl(e.CommandArgument).ToString()Session("CurrentCat") = CurrentCatCurrentCat = CurrentCat.Replace(" ", "")CurrentCat = CurrentCat.Replace("&", "-")CurrentCat = CurrentCat.Replace(",", "-")Response.Redirect("~/Adverts/SearchCategory.aspx?Cat=" & CurrentCat)and here the error message, which I get on the first line of the above code:Object reference not set to an instance of an object. 解决方案 这篇关于repeater findcontrol System.NullReferenceException:对象引用未设置为对象的实例。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-23 20:43