473,385 Members | 1,856 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,385 software developers and data experts.

button no longer fires - help!

I have a page on a customer's site - asp.net, c#, hosted on windows 2003.
There's a server-side button on the page which updates a value in a sql
database. This has worked fine for months, but mysteriously stopped working
about 10 days ago. It still works fine in my local dev environment (win xp),
and reposting the code doesn't do any good. I even tried deleting the button
and recreating it. I came up with a work around - using a linkbutton (using
the same codebehind function) to execute the database query. I asked the
hosting provider if they did anything recently to the server, and they claim
they only installed a few updates from windowsupdate.

I just noticed my own web site hosted from them has the same problem with my
contact form. My contact form has a button which uses cdo to send the
results of the form to an email address. This also worked fine up until 10
days ago.

Any ideas??? Has anybody encountered similar problems?? I'm kind of at a
loss at this point... TIA

The c# code for my page (http://www.infomend.com/contactus.aspx) is below if
it helps. Thanks!

- Chris

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;

namespace infomend
{
public class contactus : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtName;
protected System.Web.UI.WebControls.TextBox txtCompany;
protected System.Web.UI.WebControls.TextBox txtPhone;
protected System.Web.UI.WebControls.TextBox txtEmail;
protected System.Web.UI.WebControls.DropDownList ddlTimeframe;
protected System.Web.UI.WebControls.DropDownList ddlBudget;
protected System.Web.UI.WebControls.DropDownList ddlProjectType;
protected System.Web.UI.WebControls.TextBox txtDescription;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator2;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator3;
protected System.Web.UI.WebControls.TextBox txtBestTime;
protected System.Web.UI.WebControls.LinkButton lnkSubmit;
protected System.Web.UI.WebControls.Label lblResults;

private void Page_Load(object sender, System.EventArgs e)
{
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lnkSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void btnSubmit_Click(object sender, System.EventArgs e)
{
if (Page.IsValid)
{
string body = "";
body += "Name: " + this.txtName.Text + Environment.NewLine;
body += "Company: " + this.txtCompany.Text + Environment.NewLine;
body += "Phone: " + this.txtPhone.Text + Environment.NewLine;
body += "Best time to call: " + this.txtBestTime.Text +
Environment.NewLine;
body += "Email: " + this.txtEmail.Text + Environment.NewLine;
body += "Timeframe: " + this.ddlTimeframe.SelectedItem.Value +
Environment.NewLine;
body += "Budget: " + this.ddlBudget.SelectedItem.Value +
Environment.NewLine;
body += "Project Type: " + this.ddlProjectType.SelectedItem.Value +
Environment.NewLine;
body += "Description: " + this.txtDescription.Text +
Environment.NewLine;
try
{
SendEmail("sa***@infomend.com", "qu************@infomend.com", "Quote
Request",
body, MailFormat.Text);
this.lblResults.Text = "Quote processed. A sales representative will be
contacting you shortly!";
}
catch (Exception mailErr)
{
this.lblResults.Text = "Error processing quote: " +
mailErr.Message.ToString();
}
}
}

public static void SendEmail(string To, string From, string
Subject, string Body, System.Web.Mail.MailFormat Format)
{
System.Web.Mail.MailMessage Mailer = new
System.Web.Mail.MailMessage();
Mailer.From = From;
Mailer.To = To;
Mailer.Subject = Subject;
Mailer.Body = Body;
Mailer.BodyFormat = Format;
System.Web.Mail.SmtpMail.Send(Mailer);
}
}
}

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 4/9/2004
Nov 18 '05 #1
0 1096

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

Similar topics

2
by: Vinita Sharma | last post by:
Hi All, I have a strange problem. I have 2 text boxes and a button in my form. There is a function called on onchange event of the first text box. There is another function called on onclick...
0
by: Flack | last post by:
Hello, I encountered a strange problem and I do not know what is causing it. I created an empty form, added a tabs control to it and set the tab control dock style to fill. Then I added three...
2
by: Stephen Russell | last post by:
Having a brain fart this morning :( I need to take the text of a button in a datagrid. <Grid could be sorted so I need it's data that is displayed> Button Click fires: public void...
0
by: Chris K | last post by:
I have a page on a customer's site - asp.net, c#, hosted on windows 2003. There's a server-side button on the page which updates a value in a sql database. This has worked fine for months, but...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
7
by: Jimmy Jazz | last post by:
Hi, I have created a control with some buttons an alphabet. When one of these buttons are pressed it posts back and in the postback event for the button pressed a list of tems is created with a...
6
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook...
1
by: Vince | last post by:
I'm using VS 2003 and I have a button in a page where I've used "btnViewData.Attributes.Add ("onclick", "javascript:return doPostBack (\"" + btnViewData.ClientID + "\");");" to have it execute...
8
by: Harvey Schmidlapp | last post by:
I have a fairly complex form (generated by means of an ASP 3 page). The form is used to define a query against a database. After running a query, the user hits their browser's back button and goes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.