473,405 Members | 2,421 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,405 software developers and data experts.

Publish web site wrror

When I publish my web site and open the page I get the following error:

[NullReferenceException: Object reference not set to an instance of an
object.]
izpisTV.OnInit(EventArgs e) +84
System.Web.UI.Control.InitRecursive(Control namingContainer) +316
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +694
The error is happening in this method:

override protected void OnInit(EventArgs e)
{
imgC = new ImageButton();
imgC.ImageUrl = "./images/imgC.gif";
if ((Boolean)Application["language"] == true)
{
imgC.Visible = true;
}
else
{
imgC.Visible = false;
}
imgC.CausesValidation = false;
imgC.Click += new ImageClickEventHandler(this.imgC_Click);
ContentPlaceHolder cntPH;
cntPH = (ContentPlaceHolder)Master.FindControl("cntC");
cntPH.Controls.Add(imgC);
base.OnInit(e);
}

In developmnet version everything works perfect. The error is only on
published web site.

What could it be?

Regards,Simon
May 19 '06 #1
1 998
I found what the problem is:

Application object is not accessible when I publish my site into dll's.
((Boolean)Application["language"] is null

Does anybody know why?

If I just copy all files and create web site than everything works.

I belive that this is a bug.

regards,Simon

"simonZ" <si*********@studio-moderna.com> wrote in message
news:eC*************@TK2MSFTNGP05.phx.gbl...
When I publish my web site and open the page I get the following error:

[NullReferenceException: Object reference not set to an instance of an
object.]
izpisTV.OnInit(EventArgs e) +84
System.Web.UI.Control.InitRecursive(Control namingContainer) +316
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +694
The error is happening in this method:

override protected void OnInit(EventArgs e)
{
imgC = new ImageButton();
imgC.ImageUrl = "./images/imgC.gif";
if ((Boolean)Application["language"] == true)
{
imgC.Visible = true;
}
else
{
imgC.Visible = false;
}
imgC.CausesValidation = false;
imgC.Click += new ImageClickEventHandler(this.imgC_Click);
ContentPlaceHolder cntPH;
cntPH = (ContentPlaceHolder)Master.FindControl("cntC");
cntPH.Controls.Add(imgC);
base.OnInit(e);
}

In developmnet version everything works perfect. The error is only on
published web site.

What could it be?

Regards,Simon

May 19 '06 #2

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

Similar topics

8
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my...
6
by: ewolfman | last post by:
Hi, I've read many posts in several news groups, but can't figure out how to publish my website. The specific error I'm getting (on the "successfully published website") is "Could not load the...
9
by: Alex Greenberg | last post by:
I don't know, but I find the Publish Web Site feature very lacking and weak. I mean, why does the damn thing have to delete unrelated directories like /images /documents etc. This is so...
10
by: WT | last post by:
Hello, I have been publishing my web site many times to the remote where resides my final web site. Everything was ok, but to-day, without any configuration change, vs doesn't copy final files...
3
by: Stan | last post by:
What exactly is required in order to use Publish Web Site dialog in VS.NET 2005? Permissions, Front Page extenstion, etc? I keep getting different erros all the time - login boxes, server...
3
by: Tom | last post by:
I did a Build --Publish web site last night on my web app, It publish correctly but it created 12 DLL's for it. Is there a way to only get 1 dll for the entire web project like in 03 or a is there...
2
by: genc_ymeri | last post by:
Hi over there, I suddenly started to get the below error when I try to publish my websites, in any of them ! I tried to google it but not much info. Any help very much appreciated, thanks...
3
by: jfarrell | last post by:
Hi there, Im attempting to publish my site to local then copy files to the web server. The only option there seems to be in VWDE is to build/copy the site...where is the Publish website option...
9
by: Jason | last post by:
Hi all, I am no longer able to publish a web site project using Visual Studio 2005 Professional. I am publishing it to an FTP url, and this used to work just fine. I enter the username and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.