Try this if the pagelet4.aspx.vb is in the same project
1)Drag and drop the usercontrol from the solution explorer to the webform control
2)Give an id to the user control say login1.
3)In the code behind file(pagelet4.aspx.vb) change the class modifier to public(orginally mustinherit).
4)Declare the variable pointing to usercontrol
Protected WithEvents l1 As pagelet4(It is not automatically added as webform controls)
5)Get a reference to the usercontol from the page_load by
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
11 = DirectCast(FindControl("lo
End Sub
6)Form any events ay button_click get the value
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Page.IsPostBack Then
response.write(l1.password
end if
I hope this will work
Joe
Main Topics
Browse All Topics





by: davekyPosted on 2002-10-29 at 01:56:07ID: 7382313
I do not think this is possible in the way you envisage it. It would be great if it was. However, I feel you need to expand your user control to put the values into session state so that they are available across page invokations.
like:
Public Property UserId As String
Get
Return UserName.Text
End Get
Set
UserName.Text = Value
session("Username") = value
End Set
End Property
Public Property Password As String
Get
Return Pass.Text
End Get
Set
Pass.Text = Value
Session("Pass")=value
End Set
End Property
These would then be available from any page in the session. You could even expand the usercontrol even more to check if the session values are present and pre-set the properties for the user.