2010-09-27 59 views
0

我有以下代碼如何將會話值獲取到ASP參數標記中?

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
UpdateCommand="UPDATE [gMeter] SET ... [userId] = @userId ... 

我需要parametr @userId分配會話變量Session["userId"],任何想法?我試過

[userId] = <%= Session["userId"]%> 

但它不起作用。

回答

5

試試這個你asp:SqlDataSource

<asp:SessionParameter Name="userId" SessionField="userId" Type="Int32" /> 
+0

謝謝你,優秀的答案裏面:) – markoniuss 2010-09-27 13:37:05