Problem with custom web server control

B

billsahiker

I need help diagnosing an error that occurs on the web server where my
web site is hosted, but
it does not occur when I run it under VS2005. I have an errors.aspx
page that captures unhandled application errors. The error I get from
Server.GetLastError() is:
"The server cannot fulfill your request."

Scenario: I developed a composite web server control in C# . It is on
a web page in an ASP project I developed with VB as the language. The
web server control has a Close button that I have wired to
the onclick event to raise the "CloseClick" event in the web page,
which pops a messagebox asking user if they want to save changes. This
works on a local machine under VS2005, but on the server that is
hosting the application, when I click the Close button I get the above
mentioned error. I am using one of those virtual hosting companies.
This is a personal project; I do not have servers to test things on,
just my local pc.

I am not sure if it is my code, the configuration on the webserver, or
how to diagnose the problem. I extracted the pertinent parts of the
code for the Close button -there are several controls and other
buttons, but the close button is the only control that causes raises
an event on an .aspx page.
From the C# class library which I compile to a .dll and add to my web
project.

public class ListSelector : CompositeControl, IPostBackDataHandler
{
public ListSelector()
{
btnClose.Click += new EventHandler(btnClose_Click);
}

public event EventHandler CloseClick;

btnClose.ID = "btnClose";
btnClose.EnableViewState = false;
btnClose.Text = this.CloseButtonCaption;

this.Controls.Add(btnClose);

this.btnClose.Attributes.Add("onclick", "return true;");

protected override void Render(HtmlTextWriter output)
{
this.btnClose.Attributes.Add("onclick", "return true;");
base.Render(output);
}

protected void btnClose_Click(object sender, EventArgs e)
{
if (this.CloseClick != null) this.CloseClick(this, new
EventArgs());
}


In the .aspx page the following event captures the button's click
event. This is raised when run
from VS2005, but not on the web server.

Protected Sub ListSelector1_CloseClick(ByVal sender As Object, ByVal
e As System.EventArgs) Handles ListSelector1.CloseClick
Try
If MsgBox("Save changes?", MsgBoxStyle.YesNo, "Moxie
Quotes") = MsgBoxResult.Yes Then
'several lines of code here
Catch ex As Exception
MsgBox("Unable to save
parameters",MsgBoxStyle.Information)
End Try
End Sub

Bill
 
M

Mr. Arnold

I need help diagnosing an error that occurs on the web server where my
web site is hosted, but
it does not occur when I run it under VS2005.

I think you need to publish it to your local Web server and see if the
problem follows.

It talks about a misconfiguration of a Web server when a *request cannot be
fulfilled*.

http://www.microsoft.com/technet/archive/office/office97/reskit/fp98serk/TROUBLE.mspx?mfr=true

The Web site Publishing feature in VS 2005 that's compiling the code can
hide a problem when it's deployed to a Web server.

I had a situation were an Oracle dll I was using on the workstation was not
the same version that was out on the Web server. So, when the application
started, it was giving some off the wall error condition. I had a feeling it
was the dll, but I couldn't say for sure.

It became clear that it was a dll problem when the solution was not
published using VS 2005, and it was put out there on the Web server to be
compiled and executed at the server.
 

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

Top