Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Accessing Web User Control Values From ASPX Code Behind

Reply
Thread Tools

Accessing Web User Control Values From ASPX Code Behind

 
 
Jason
Guest
Posts: n/a
 
      10-06-2005
Does anyone know how to do this?

cntHeader is my control.

When I try to set the value of lblDistributor = label1.text, I get the
following error.

Object reference not set to an instance of an object

PLEASE HELP!

Here is my current code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim strSQL As String

Dim rs As ADODB.Recordset

Dim rsUser As ADODB.Recordset

Dim cntHeader As headerinfo

strSQL = "EXEC mf_Partners.dbo.spTblDistributors_Select_ByDistrib utorID " &
Session("DistID") & ""

rs = Global.ReturnRS(strSQL)

strSQL = "EXEC mf_Partners.dbo.spTblDistributorsContacts_Select " &
Session("DistID") & ", '" & Session("UserID") & "'"

rsUser = Global.ReturnRS(strSQL)

If Not rs.EOF Then

HEditProfile.NavigateUrl = "acct_edit.aspx?Email=" & Session("UserID") & ""

HOrderMaterial.NavigateUrl =
"http://www.jacksongroup.com/modernfold/WebLogin.asp?GRP=" & _

Trim$(rs("MaterialCode").Value & "") & "&DST=" & Session("DistID") & _

"&FNAME=" & Trim$(rsUser("UserFName").Value & "") & "&LNAME=" &
Trim$(rsUser("UserLName").Value & "") & _

"&ADDR=" & Trim$(rs("Address1").Value & "") & "&CITY=" &
Trim$(rs("City").Value & "") & _

"&ZIP=" & Trim$(rs("ZipCode").Value & "") & "&PHONE=" &
Trim$(rs("Phone").Value & "") & "&EMAIL=" & _

Session("UserID") & ""



End If

rs.Close()

rs = Nothing

rsUser.Close()

rsUser = Nothing

Label1.Text = cntHeader.lblDistributorName.Text



End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to bring aspx code (in HTML view) to the aspx.vb code-behind? Paolo Pignatelli ASP .Net 6 02-21-2005 01:55 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
User Control; read value from hosting aspx code-behind Gene ASP .Net 7 04-19-2004 07:15 PM
Accessing Web User Control from code behind Michael Morse ASP .Net Building Controls 0 01-23-2004 06:56 PM
accessing page variable from user control code behind Gerald ASP .Net 1 07-04-2003 04:33 PM



Advertisments