|
based on what you wrote it looks right.
Provide what the error is and code from the opener to get an answer. also code for when it's called.
|
|
|
|
|
Is there anything wrong with this? This is verbatum how is looks on the server but it wont send. It takes you to the redirect page while its simultaneously attempting to send the form fields to the mail server (smtp.whatever.com) and the redirect page give you the 'else' error at the very bottom.
protected void SendMail(String strBody)
{
String strONOES;
String strFromEmail = "joel.dunn@yahoo.com";
String strFromName = "Dealer Request";
try
{
MailMessage msgMail = new MailMessage();
MailAddress maFrom = new MailAddress(strFromEmail, strFromName);
msgMail.From = maFrom;
msgMail.To.Add(new MailAddress("joel.dunn@yahoo.com"));
msgMail.ReplyTo = (new MailAddress(txtEmail.Text));
msgMail.Subject = "Bathwraps Find a Dealer";
msgMail.IsBodyHtml = true;
msgMail.Body = strBody;
SmtpClient mSmtpClient = new SmtpClient();
mSmtpClient.Host = "smtp.bathwrapstexas.net";
mSmtpClient.Send(msgMail);
Session["Request"] = "Request";
-------------------------------------------------------------------------------------------------
protected void SetLabel()
{
if (Session["Request"] == "Request")
{
lblBody.Text = "Thank you for your submission. You will be contacted soon about becoming a Bathwraps dealer.";
}
else if (Session["Request"] == Request)
{
lblBody.Text = "Thank you for your submission. A Bathwraps dealer will be contacting you shortly.";
}
else
{
lblBody.Text = "There was an error submitting the e-mail form. Please try again later.";
}
}
If I said something clever or genius here I'd feel repetitious...
|
|
|
|
|
make changes at follows
instead of mSmtpClient.Host = "smtp.bathwrapstexas.net"
put your mail domain
eg.
mSmtpClient.Host = "mail@bathwrapstexas.net"
this will work
try this
Regards
Keyur
"Always Be Happy, Live Life Long"
|
|
|
|
|
I have the following coding in my web form.
var type = (from p in entities.Address select p);
this.GridView2.DataSource = type;
this.GridView2.DataBind();
Here in table Address I have one column named "Status" which is foreign Key. When I selected all the columns and try to bind with GridView it is not showing that column which is forign key. What is the reason.
Thanks
|
|
|
|
|
Hi,
where i can find real information about speed and usability of ASP.NET as a platform for online game?
Someone knows any online games(in web browser) which used ASP.NET not PHP?
Greetings
|
|
|
|
|
I can't find to many good resources at all, and fewer less examples, I don't know if ASP.NET is right for a gaming application.
I might be wrong, better wait for a more experienced answer.
|
|
|
|
|
Using ASP.Net as a platform for webbrowser based online game is like using the Safety Car in a Formula 1 race. You will slow down resources and lose the scope.
|
|
|
|
|
Any links to reliable information on which your opinione is based?
|
|
|
|
|
If your game has 3D and graphics effects, think about Silverlight. It can be hosted on top of asp.net 2.0 platform.
|
|
|
|
|
|
|
hi,
i like to enter the date using three drop down lists
i.e in the first dropdownlist it must show date 1 to 31
In second drop down list it must show names of the months like jan,
feb,mar,apr.....
In third drop down list it must show the years 1.e from 1947 to
current year (2009).
And one more is in my databse i like to save my date in the format
of 1/01/2000.
how i can change my string value jan,feb to int value i.e 01,02...
in the database.
Plz help me by posting the code...its very urgent....
Thanx in advance
|
|
|
|
|
Dropdown List containing two property one is "Text" and other is "Value".
Now Text field you can use month name and Value field you can use as number value.
<asp:DropDownList ID="t" runat="server">
<asp:ListItem Text="Jan" Value="01"></asp:ListItem>
</asp:DropDownList>
Parwej Ahamad
|
|
|
|
|
Hi,
I am using ASP.Net 1.1. I want to stop getting run time messages when the application is run and the complete trace information. How can I do the same.
I have already done this in web.config file
<compilation defaultlanguage="vb" debug="false">
and even on the page level.
I even compiled my applicaiton in Release mode.
Removed all the .pdb files previously generated.
But still I am getting the run time message.
Rgds,
Renu
|
|
|
|
|
Is there Try and Catch is not helpful for the same ?
Parwej Ahamad
|
|
|
|
|
Try and catch are there..but there are many time run time error's which are not catched.
|
|
|
|
|
Renu A wrote: But still I am getting the run time message.
What do mean by a run time message?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Run time error such as: If instead the below can't I get page cannot be displayed.
Server Error in '/SOL/SolOnline' Application.
--------------------------------------------------------------------------------
ORA-00933: SQL command not properly ended
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Oracle.DataAccess.Client.OracleException: ORA-00933: SQL command not properly ended
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OracleException: ORA-00933: SQL command not properly ended]
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) +693
Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() +2128
SlcCore.OracleWebConnection.ExecuteCommand(String sqlStatement)
SlcCore.ApplicationRunInformation.LogoutSession()
SlcCore.ApplicationRunInformation..ctor(HttpRequest request, HttpResponse response, String oracleConnectionInformation, String cookieIdentifier, Boolean blnLogout)
CSolOnline.CSOLFunctions.PageLogout(HttpRequest& request, HttpResponse& response) +51
CSolOnline.LogoutUserCtrl.Logout_Click(Object sender, EventArgs e) +56
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1277
|
|
|
|
|
Gosh!!!
This is no message but an excpetion.
Look at this [^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
yes i know...I have purposely added that error .............but can we handle that...I have also given one more update in my earlier mail as to what exactly is happening.
|
|
|
|
|
I got a nice article which mentions how to handle undhandled error.
http://www.15seconds.com/issue/030102.htm
It even works when the error is on the webpage itself.
But now my problem is, In the code we have used a dll. (which is a seperate project type of classlibrary). Now in this when the sql fires and if it gives error in the catch block it directly says as
Throw Exception.
Now that's the problem. This error does not come on the webpage as it is not trapped. It directly throws the error in the dll itself.
Can I handle this error in my application without changing my code??
Thanks.
Rains
|
|
|
|
|
Newbie question here: I’ve got a page with a text box with a requered field validator and a label that should say “OK” if there is text in the field (using Page.IsValid) or “Bad” if not. However, it doesn’t say “Bad” when there is no text. Below is the page code and the source code. Can anyone help me under stand why this is happening? Thanks!
PAGE CODE:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="pageIsValidTest.aspx.vb" Inherits="pageIsValidTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Textbox:
<asp:TextBox ID="TextBox" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox"
ErrorMessage="enter text"></asp:RequiredFieldValidator><br />
<asp:Button ID="Button1" runat="server" Text="Button" /><br />
Label:
<asp:Label ID="Label" runat="server"></asp:Label></div>
</form>
</body>
</html>
SOURCE CODE
Partial Class pageIsValidTest
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Page.IsValid Then
Label.Text = "OK"
Else
Label.Text = "Bad"
End If
End Sub
End Class
|
|
|
|
|
Hi BigMish2,
You need to validate the page before you can tell if it's valid:
Page.Validate()
If Page.IsValid Then
Label.Text = "OK"
Else
Label.Text = "Bad"
End If
I hope this helps.
Ryan
|
|
|
|
|
Thanks Ryan but unfortunately that did not work.
Update: interestingly I get the same behavior as with the code I posted before with the following source code (meaning that Label only displays “OK” if I put text in the text box even when I comment out the conditional!):
Partial Class pageIsValidTest
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'If Page.IsValid Then
Label.Text = "OK"
'Else
'Label.Text = "Bad"
'End If
End Sub
End Class
What is going on?!
|
|
|
|
|
I'm not sure why it wouldn't work after you'd added the Page.Validate()line, does it give an error?
You've commented out the condition the condition, but you haven't commented out Label.Text = "OK" so every time you click the button it will set the labels text to OK regardless of what you do on the page.
|
|
|
|