Velocity Reviews

Velocity Reviews (
-   ASP .Net Building Controls (
-   -   Problem with UserControl Property in a DataGrid after Postback (

Andreas Klemt 07-08-2003 03:18 PM

Problem with UserControl Property in a DataGrid after Postback
I have this

<%@ Register TagPrefix="uc1" TagName="Userdetails" Src="Userdetails.ascx" %>
<asp:datagrid id="dgTest" runat="server" autogeneratecolumns="False" >
My UserID is: <%# Container.DataItem("userID") %><br> <<<--- THIS WORKS,
<uc1:Userdetails id="ctlUserdetails" userid='<%#
Container.DataItem("userID") %> runat="server" /> <<<----- AFTER
POSTBACK userid=0


Dim _userID As Integer
Public Property ClientID() As Integer
Return _userID
End Get
Set(ByVal Value As Integer)
_userID = Value
End Set
End Property

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write (_userID & "<br>")
End Sub

The first time the page gets loaded everything works fine.

When I do a Postback, in my DataGrid the the userID's are ok with the first
My UserID is: <%# Container.DataItem("userID") %>

but in my UserControl Property Call

<uc1:Userdetails id="ctlUserdetails" userid='<%#
Container.DataItem("userID") %>

the userid is =0. Why?

Thanks for any help!

All times are GMT. The time now is 10:52 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.