App works locally but not on the website

M

Mark Sandfox

I created a simple calendar test app (webform1.aspx) using Visual Studios,
which works perfectly in local debug mode, but has no functionality when
posted to the website. I.e. the label fills with date information on
calendar1_selctionchanged only when run locally, but not when posted to the
website. I must be missing something very simple here. In the past I have
hand coded all my asp.net code. Page code snippet below.



Thank you in advance for your help.



Public Class WebForm1

Inherits System.Web.UI.Page

Protected WithEvents lResults As System.Web.UI.WebControls.Label

Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

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

'Put user code to initialize the page here

End Sub

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged

If Calendar1.SelectedDates.Count = 1 Then

lResults.Text = Calendar1.SelectedDate

ElseIf Calendar1.SelectedDates.Count = 7 Then

lResults.Text = "Week of " & Calendar1.SelectedDate & " - " &
DateAdd(DateInterval.Day, 6, Calendar1.SelectedDate)

Else

lResults.Text = Format(Calendar1.SelectedDate, "MMMM") & " has " &
Calendar1.SelectedDates.Count.ToString & " days."

End If

End Sub

End Class
 
G

Guest

I created a simple calendar test app (webform1.aspx) using Visual Studios,
which works perfectly in local debug mode, but has no functionality when
posted to the website. I.e. the label fills with date information on
calendar1_selctionchanged only when run locally, but not when posted to the
website. I must be missing something very simple here. In the past I have
hand coded all my asp.net code. Page code snippet below.

Thank you in advance for your help.

Public Class WebForm1

Inherits System.Web.UI.Page

Protected WithEvents lResults As System.Web.UI.WebControls.Label

Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

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

'Put user code to initialize the page here

End Sub

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged

If Calendar1.SelectedDates.Count = 1 Then

lResults.Text = Calendar1.SelectedDate

ElseIf Calendar1.SelectedDates.Count = 7 Then

lResults.Text = "Week of " & Calendar1.SelectedDate & " - " &
DateAdd(DateInterval.Day, 6, Calendar1.SelectedDate)

Else

lResults.Text = Format(Calendar1.SelectedDate, "MMMM") & " has " &
Calendar1.SelectedDates.Count.ToString & " days."

End If

End Sub

End Class

You do ASP.NET Code Behind Page. Did you build your application and
copied \bin to the server?
 
M

Mark Sandfox

Yes all the generated pages are on the server.

Anon User said:
You do ASP.NET Code Behind Page. Did you build your application and
copied \bin to the server?
 
G

Guest

Yes all the generated pages are on the server.

You should copy all DLLs and references from the /bin folder and all
content files (*.aspx, *.ascx).

Do you have .NET Framework intstalled on your server?
Do you have Application created on IIS?

What error do you have when you call http://.../webform1.aspx?

It can be that you don't see complete error in your browser because of
"friendly HTTP error messages".
More information how to disable: http://support.microsoft.com/kb/294807/
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top