开发者

Object reference error in Master Page

开发者 https://www.devze.com 2023-03-25 21:47 出处:网络
I am getting the following error at runtime: \"Object reference not set to an instance of an object.\" - the code in question in my code-behind is as follows:

I am getting the following error at runtime:

"Object reference not set to an instance of an object." - the code in question in my code-behind is as follows:

Dim MinDateDataView As DataView = CType(SqlMinDate.Select(DataSourceSelectArguments.Empty), DataView)
Dim MinDateDataRowView As DataRowView = MinDateDataView.Item(0)

This is only a proble开发者_C百科m when it's used in a master page. Can anyone help me out? Thanks


Have you perform SqlMinDate.DataBind() for the SqlDataSource?


<SelectParameters>
        <asp:FormParameter FormField="ctl00$MainContent$txtSubID" Name="SubID" Type="Int32" />
    </SelectParameters>

Checking the html source I've used the master page control name, and it's worked. Just came back to it after leaving it for a while, as is often the case.

0

精彩评论

暂无评论...
验证码 换一张
取 消