473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
Feb 6 '07 #1
0 1047

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
1
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
2
by: shapper | last post by:
Hello, I need to set, at runtime, MyLabel.SkinID="MySkinID". I know this must be done in Page PreInit event. However, MyLabel is in my Master Page. I tried to add the Page PreInit event...
6
by: Rahul | last post by:
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...
8
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
0
by: =?Utf-8?B?TWFyayBHaWxrZXM=?= | last post by:
I have designed and written a custom menu like server control. The control inherits from DataBoundControl and implements INamingContainer and IPostBackEventHandler interfaces. The control uses only...
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
4
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.