B
Big George
Hello,
I've got an aspx webpage with:
- MyUserControl1 (which shows some labels)
- A Panel containing MyUserControl1
- DataGrid, which has a column that when is clicked fires Sub edit_
<asp:datagrid id="MyDataGrid" runat="server" Width="100%"
Visible="True" oneditcommand="edit_">
..................
</asp:datagrid>
</aspanel><aspanel id="MyPanel" runat="server">
<uc1:myUserControl id="myUserControl1"
runat="server"></uc1:myUserControl>
</aspanel>
Protected myUserControl1 As myUserControl
Public Sub edit_(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
myUserControl1.SomeProperty = "SomeStuff"
MyPanel.Visible = True
End Sub
However, when myUserControl shows up on the webpage, SomeProperty is
null. It doesn't take the value assigned in Sub edit_
Is there any way to assign a value to myUserontrol.SomeProperty when
edit_ is fired?
Because here it works:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
myUserControl1.SomeProperty = "SomeStuff" ' when myUserControl1
shows up, SomeProperty has value "SomeStuff"
End Sub
I've got an aspx webpage with:
- MyUserControl1 (which shows some labels)
- A Panel containing MyUserControl1
- DataGrid, which has a column that when is clicked fires Sub edit_
<asp:datagrid id="MyDataGrid" runat="server" Width="100%"
Visible="True" oneditcommand="edit_">
..................
</asp:datagrid>
</aspanel><aspanel id="MyPanel" runat="server">
<uc1:myUserControl id="myUserControl1"
runat="server"></uc1:myUserControl>
</aspanel>
Protected myUserControl1 As myUserControl
Public Sub edit_(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
myUserControl1.SomeProperty = "SomeStuff"
MyPanel.Visible = True
End Sub
However, when myUserControl shows up on the webpage, SomeProperty is
null. It doesn't take the value assigned in Sub edit_
Is there any way to assign a value to myUserontrol.SomeProperty when
edit_ is fired?
Because here it works:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
myUserControl1.SomeProperty = "SomeStuff" ' when myUserControl1
shows up, SomeProperty has value "SomeStuff"
End Sub