|
halo..
I want to send email to my account but this program run twice. So,after click on submit button, 2 same mails send to my account.How this could happen?
Thanks.
<code><small>Imports System.Net.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Try
Dim message As New MailMessage(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text)
Dim emailClient As New SmtpClient(txtSMTPServer.Text)
emailClient.Send(message)
litStatus.Text = "Message Sent"
Catch ex As Exception
litStatus.Text = ex.ToString()
End Try
End Sub
|
|
|
|
|
There seems to be nothing wrong with the code above.
Can you check it with another e-mail address, plus possible post anymore code you have for that page
cheers
|
|
|
|
|
hi,
put your code within the
If Not IsPostBack Then
Dim message As New MailMessage(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text)
Dim emailClient As New SmtpClient(txtSMTPServer.Text)
emailClient.Send(message)
litStatus.Text = "Message Sent"
END IF
hope this helps...
|
|
|
|
|
There are two pages , one is login page(aspx) and another is html page . i want to get login page desing into html page at runtime using Ajax is there any option to do that.
|
|
|
|
|
There's no built in option to do anything, you need to write code. Not sure what you want exactly, you want to download HTML using AJAX and inject it into your login page ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
download aspx content and inject into html page
|
|
|
|
|
That is what is being classified as 'Wierd'. You might run into Scripting Errors when the XmlHttp fails due to any errors on the server.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
OK - so you want to make a basic AJAX call, and inject the result into your page ? Not using theh ASP.NET AJAX library, as you call an ASPX but run it in a straight HTML page ?
I guess you'll get your HTML as the string coming back from the AJAX call, and then you can just use document.getElementById to get a div or something in your page and set it's content to be the HTML.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
prabumjkaran wrote: get login page desing into html page at runtime using Ajax
Weird. I would suggest you can have a simple login link and when you click popup a small DIV to get the username and password. Submit these through AJAX and based on the response either redirect the user or halt on the same page till further retries are exhausted by the user.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello frnds,
i have a web cam connected to machine. i want to develope a web site which shows the picture from web cam and on click of grab frame it will save a still from web cam.
any idea ???? code sample ????
pls. help....thankx in advance
Koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
CAn't do it. ASP.NET generates javascript and HTML and neither can do that. A .NET or ActiveX control may be able to, and a website can host tat, but it won't really involve ASP.NET
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thankx a lot....
any example ?????
Koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
thankx
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
hai,
currently i m using asp.net with c# (.net 2005, 2.0 framework)
i have stored a image to my database (sql server 2000) and want to retrive it and display in a image control.
i use the below code..
using (BinaryReader reader = new BinaryReader(BrowseImg.PostedFile.InputStream))
{
byte[] image = reader.ReadBytes(BrowseImg.PostedFile.ContentLength);
conn.Open();
cmd = new SqlCommand("INSERT INTO tbl_test(my_image) VALUES (@Photo)",conn);
cmd.Parameters.AddWithValue("@Photo", image);
rowsAffected = MyLib.cmd.ExecuteNonQuery();
conn.Close();
} - FOR insert image into database
Response.Clear();
Response.ContentType = "image/jpeg";
Image image = null;
conn.Open();
cmd = new SqlCommand ("SELECT my_image from tbl_test",MyLib.conn);
byte[] imageData = (byte[])MyLib.cmd.ExecuteScalar();
MemoryStream memStream = new MemoryStream(imageData);
image = Image.FromStream(memStream);
image.Save(Response.OutputStream, ImageFormat.Jpeg); - for display image
but its displaying in my page itself... i need to display on an image control or in some control..
how to implement this? - KARAN
|
|
|
|
|
You need to write a HTTP handler that takes on the URL an ID that tells it what image to load and send back. Then you use IMG tags that have that URL as their src
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
this coding i got from google....
can u provide the exact code to fulfil my process?
|
|
|
|
|
Dude ..
byte[] photo = (byte[])dr[0];
MemoryStream ms = new MemoryStream(photo);
//Image im = new Image();
//Icon.ImageUrl =
Bitmap bt = new Bitmap(ms);
....> Response.OutputStream.Write(photo, 0, photo.Length);
here dr is a data row
take a aspx page ... in that write this code
Now to the image control add the image url as the aspx page
This will work
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
thanks for u r coding krazy... but i m getting error Invalid attempt to read when no data is present.
my code:
conn.Open();
cmd = new SqlCommand("SELECT my_image from test123",conn);
dr = cmd.ExecuteReader();
byte[] photo = (byte[])dr[0];
MemoryStream ms = new MemoryStream(photo);
Bitmap bt = new Bitmap(ms);
Response.OutputStream.Write(photo, 0, photo.Length);
|
|
|
|
|
Not sure what the other dude gave you, looks like a mess to me.
You write a HTTP handler, and it does the response.binarywrite. I'm sure there are examples here on CP
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for u r reply chris...
can i get a sample coding atleast?
since i m not familiar with http process and imaging
|
|
|
|
|
http://www.codeproject.com/KB/web-image/thumbnailer.aspx[^]
seems like a place to start.
But, it's really as simple as placing the code you have, in a HTTP handler, and doing what I said.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
|
i am using the following code in page load event
<br />
dim CurrentPageURL<br />
<br />
CurrentPageURL= Request.UrlReferrer.ToString()<br />
is it correct?
|
|
|
|