Preinit event says server Control not referenced if used in Master/Content pages

R

Rahul

this is my code in preinit event
I have "hlinkAdd" as hyperlink web control and i am using a master page, and
below code is of content page preinit event.

Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreInit
If Request.QueryString("process") = "" Or
Request.QueryString("process") = "Add" Then
hlinkAdd.SkinID = "up" (error is thrown here Object reference
not set to an instance of an object)
hlinkAdd.NavigateUrl = ""
trCompanyName.Visible = False
ElseIf Request.QueryString("process") = "Edit" Then
'LinkEdit.ForeColor = Drawing.Color.Aqua
hlinkEdit.SkinID = "up"
hlinkEdit.NavigateUrl = ""
cmbCompanyName.AutoPostBack = True
trCompanyName.Visible = True
End If
End Sub

I get the following error ....


Please help me ...

Rahul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top