I have a sqlDataSource in which I use select parameter as below :
<asp:sqlDataSource ID="EmployeeDetailsSqlDataSource"
SelectCommand="SELECT EmployeeID, LastName, FirstName FROM Employees WHERE EmployeeID = @EmpID"
ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>" RunAt="server">
<SelectParameters>
<asp:Parameter Name="EmpID" Type="Int32" DefaultValue="<%#userid%>" />
</SelectParameters>
</asp:sqlDataSource>
In my backend code, I have assigned a value to userId and also written this.DataBind();
The data-binding doesn't work. Does anyone know a solution to this ?