i stored session variable in string variable in .cs page , but now i want to retrieve that string variable on .aspx page and want to put into selectcommand of sqldatasource
You can reference your and use c# code within your aspx page as well. The code-behind option was introduced with asp.net but if your are familiar with classic asp you will remember that code is placed in the same page between these tags <% %>, just like in PHP <? ?>. I'm sure you've seen these tags in your aspx page with sone of the controls like the gridview and detailsview with bind and eval but just didn't think about it.
In any case say you have a subroutine in you code behind that assigns the session info, you can insert this...
<% =mySub() %>
However, for your scenario, you don't have to do this manually. When you are adding these controls that bind to a data source, when you use the wizard, during the data source wizard, you can add the parameters and just specify that source of the value. For example, that source can be a query string, session value, or even a value from another control such as a text box.
If you need a more specific example, I can post it.