我的VS 2008代码中有以下内容: 参数(0).Value =会话(" User")。CompanyID 我认为这意味着因为没有用户在这一点上,我不能这样做。 但它会在那里而且用户对象有一个CompanyID属性。 如何在我的代码中访问它? 谢谢, Tom
解决方案我也有同样的问题: Sub SetMoveList_Click(ByVal s As Object,ByVal e As EventArgs) Trace.Warn(在SetMove_Click s.id ="& s.id) Dim oPanel As Panel = s.parent Dim oDLI As DataListItem = s.parent.parent 我在s.id,s.parent和s.parent.parent上收到错误。 我曾经在2003年这样做过 - 我怎么会在这里做同样的事情? 谢谢, Tom " tshad" < tf*@dslextreme写在留言中 新闻:eG ************** @ TK2MSFTNGP04.phx.gbl ... >我的VS 2008代码中有以下内容: parameters(0).Value = Session(" User")。CompanyID 我认为这意味着因为没有用户在这一点上,我不能这样做。 但它会在那里而且用户对象有一个CompanyID属性。 如何在我的代码中访问它? 谢谢, Tom
" tshad" < tf*@dslextreme写在消息中 新闻:eG ************** @ TK2MSFTNGP04.phx.gbl ... 我的VS 2008代码中有以下内容: parameters(0).Value = Session(" User")。CompanyID 我认为这意味着因为没有用户在这一点上,我不能这样做。 但它会在那里而且用户对象有一个CompanyID属性。 如何在我的代码中访问它?
您似乎使用的是VB.NET而不是C#,所以它可能是 之类的东西: 如果会话(用户)不是,那么 参数(0).Value =会话(" User")。CompanyID 结束如果 - Mark Rae ASP.NET MVP www.markrae
tshad写道: 我的VS 2008代码中有以下内容: 参数(0).Value = Session(" User" ;)。CompanyID 我认为这意味着因为没有用户在这一点上,我不能这样做。 但它会在那里而且用户对象有一个CompanyID属性。 如何在我的代码中访问它?
嗨汤姆, 据我所知,你有CompanyID问题。 当时不知道(或者在VB.NET中有什么不同?)。在这种情况下,您必须将会话(用户)的结果转换为您期望的对象。也许这个 可以帮助你: http:/ /www.codeproject/KB/dotnet...astingNET.aspx Best, Hilmar
I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can''t do this. But it will be there and the User Object has a CompanyID property. How can I access this in my code? Thanks, Tom
解决方案 I also have the same problem with: Sub SetMoveList_Click(ByVal s As Object, ByVal e As EventArgs) Trace.Warn("in SetMove_Click s.id = " & s.id) Dim oPanel As Panel = s.parent Dim oDLI As DataListItem = s.parent.parent I am getting the error on s.id, s.parent and s.parent.parent. I used to do this in 2003 - how would I do the same thing here? Thanks, Tom "tshad" <tf*@dslextremewrote in message news:eG**************@TK2MSFTNGP04.phx.gbl... >I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can''t do this. But it will be there and the User Object has a CompanyID property. How can I access this in my code? Thanks, Tom"tshad" <tf*@dslextremewrote in message news:eG**************@TK2MSFTNGP04.phx.gbl... I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can''t do this. But it will be there and the User Object has a CompanyID property. How can I access this in my code?
You appear to be using VB.NET instead of C#, so it''s probably something like: If Session("User") Is Not Nothing Then parameters(0).Value = Session("User").CompanyID End If -- Mark Rae ASP.NET MVP www.markrae
tshad wrote: I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can''t do this. But it will be there and the User Object has a CompanyID property. How can I access this in my code?Hi Tom, as far as I see you have the problem that "CompanyID" is not known at that moment (or is this different in VB.NET?). In that case you have to cast the result of Session("User") to the object you expect. Maybe this helps you: www.codeproject/KB/dotnet...astingNET.aspx Best, Hilmar
更多推荐
后期绑定问题
发布评论