You will have to bind the value of std.SessionCode
to the ObjectDataSource in code-behind. In the "Configure Data Source" screen above, choose None for now. You'll be binding it dynamically.
If your ObjectDataSource looks like this:
<asp:ObjectDataSource ID="myObjDS" runat="server"
TypeName="YourNamespace.Notice"
SelectMethod="GetNoticesBySessionCode">
<SelectParameters>
<asp:Parameter Name="sessionCode" Type="String"/>
</SelectParameters>
</asp:ObjectDataSource>
Then
if (std != null)
{
//all the other code you have above.
myObjDS.SelectParameters["sessionCode"].DefaultValue = std.SessionCode;
myObjDS.DataBind(); //ensure you actually need this, may cause a double roundtrip to your DB.
}
p.campbell
2009-08-08 18:40:26