Web Forms :: Getting Data And Sending It In A CSV File To User
Oct 21, 2010
I'm creating an ASP.NET application that needs to get data from database (time consuming) and show some indication (e.g. gif animation) that the application is doing something. After that the data should be send to user that the user can save or open the CSV file.
I'm able to do this with two button click's. One for getting the data from the database in codebehind and using javascript to show the gif animation for user in the meanwhile. Second to use the esponse.write(myData) and response.end() to send the data for user to save in CSV file.
The problem is that I need to do this with one button click. If I combine the code to one button click handler the data is sent correctly but the gif animation is not hidden because the page is not updated. How to do this correctly with one button click?
View 5 Replies
Similar Messages:
Jul 9, 2010
I want to send mail tot multiple user using checkbox within gridbiew , but problem is it is sending mail to only first column email ID , and suppose i have four email id in databse then it will send 4 times mail to first email id,
OleDbCommand cmd = new OleDbCommand("select * from sendmail",con);
OleDbDataReader red = cmd.ExecuteReader();
if (red.Read())
{
StringBuilder str = new StringBuilder();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (isChecked)
{
str.Append(GridView1.Rows[i].Cells[3].Text);
SmtpClient sc = new SmtpClient();
MailMessage mm = new MailMessage("dnk247@gmail.com", red["nemail"].ToString());
mm.Subject = "hello";
mm.Body = "just say hi";
sc.EnableSsl = true;
sc.Send(mm);
}
}
}
View 2 Replies
Oct 12, 2010
I have a New issue. this is regarding Bulk email Sending through ASP.NET 2.0
I have 100 Email Id's & Roll No of Students in one table in DB
and their corresponding Result (Multiplae Rows as displayed in the MArksheet for One Student) in another table.
I need to send the result through an EMail to each of the student.
I am not getting any problem to sending an email.
I just want to know what is the best way to achieve this
beacuse SMTP does not support above 300 mails
each time i have to send a request to SMTP Server for sending an email Beacause of dynamic data of the student
how to achieve this while working with the SMTP Server
View 2 Replies
Sep 30, 2010
on the registration time iam getting the user firstname,lastname,email,password after clicking the submit button i have to send a mail to them with a welcome message and a link to activate the account. if they click the link i have to redirect a page that you have successfully activated. iam using c# asp.net web application.
View 4 Replies
Jan 17, 2011
I am trying to configure my web application to send emails to my email address in case of any error . Below is my coding in the web config file, I am following example from a book cuase I AMM A nOVICE TO VISUAL STUDIO AND .NET AND C#. THE NAME OF THE BOOK IS ASP.Net E-Commerce in C#. I am not sure what to put in for the MailForm value since the book did not say could someone tell me .
[Code]....
In my other configuration file under the App_Code folder I have this coding Below:
[Code]....
View 1 Replies
Mar 3, 2010
how to write a code for Sending an email notification to the user.. I work to create conference managment system that content papersubmission when researcher upload his research(in my page I have using file upload control for uploading pdf)my work after uploading the file I need to sent an email(this mail body contain the link to the page where pdf uploaded )to the reviewer that he must notice that the pdf has uploaded and commented on it. this email notification should come from admin.
View 3 Replies
Jan 7, 2010
i am trying to send a email with the info supplied from my form. i have got the code from a book im going through ( asp.net 3.5 in c# and vb ). First here is the code behind from the submit button:
Protected Sub btn_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim fileName As String = Server.MapPath("~/App_Data/ContactForm.txt")
Dim mailBody As String = System.IO.File.ReadAllText(fileName)
mailBody = mailBody.Replace("##Name##", tb_firstName.Text)
mailBody = mailBody.Replace("##Surname##", tb_surname.Text)
mailBody = mailBody.Replace("##eMail##", tb_eMail.Text)
mailBody = mailBody.Replace("##Subject##", tb_subject.Text)
mailBody = mailBody.Replace("##Description##", tb_description.Text)
Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "##Subject##"
myMessage.Body = mailBody
myMessage.From = New MailAddress("jay@jwwebdesign.net", "##Name##")
myMessage.To.Add(New MailAddress("jay@jwwebdesign.net", "Me"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.Send(myMessage)
End Sub
and here is the code from the web.config:
<system.net>
<mailSettings>
<smtp deliveryMethod ="Network" from ="Jay <[URL]>">
<network host ="smtp.jwwebdesign.net" />
</smtp>
</mailSettings>
</system.net>
when in debug mode it points the error to being:
smtp exeption was unhandled by user code Transaction failed. The server response was: m1pismtp01-001.prod.mesa1.secureserver.net and it highlights this code:.........
View 1 Replies
Sep 15, 2010
On the first hit, and only the first hit, to my page having [ALLOW users="*"] in the web.config, the user is redirected to the LoginUrl, but on all subsequent visits to the page, the user IS allowed access. The user shoud ALWAYS be allowed access to this page. I suspect it is a configuration problem, so here are snippets of my web.config...
[code]....
View 4 Replies
Sep 2, 2012
a vistor subscribes for newsletter by providing emailid.a mail should be automically sent to that email with verification link.when owner upon clicking verifcation link is confirmed to send newsletter.
View 1 Replies
Mar 4, 2010
i am sending a html file (attachment) using windows application, when i open the mail it will displays the html content including buttons, tabs, but i don't want to dispaly those buttons and tabs
View 1 Replies
Sep 8, 2010
I need send to user e-book in file format .ePub. ePub file is zip archive with
epub extension.
I try to send the file by Response object in C# code, bud all attempts cause a dialog box to open or save of file with zip extension.
Example of code
// dir and name are stirng variables with path and file name without extension
zip.Save(dir + "epub.epub"); //save file to disk
Response.Clear();
Response.ContentType = "application/octet-stream";
[Code]....
View 2 Replies
Jan 7, 2011
I have Dynamic User conl that has 2 buttons.one of them is btnOk and the other is btnCancel.in my usercontrol I want to send user information through my usercontrol into an xml file.the problem is when I click on Ok button no data is sent to xml file.
here is my code:
[Code]....
View 1 Replies
Dec 28, 2010
I want to have a web service which creates CSV data and writes it to a plain txt file on the client side. I was thinking of something like a GetData() method which returns a StringBuilder which contains the file content. The client of the service writes that into a file on the clients machine. Everything transfered needs to be secured, the web service runs together with a web app which is hosted on a https server...is calling the service secured then, too?
View 2 Replies
Mar 29, 2011
I have this web application (LAN) that sends an email when users registers to one of our events.
The code is pretty straightforward:
[code]....
The application sends the email without problems. The issue is that somehow a third person is enlisted in the cc, and receives a copy of the email!. What could be the problem? The smtp? IIS?
View 2 Replies
Oct 26, 2010
I've been pulling my hair out about this for ages. I have a WebService which sends a zip file to the browser. This works; when I test the WebService and 'invoke' the method through it directly, the zip file is downloaded to the browser correctly.
The problem arises when I use jQuery to send an AJAX request to the WebService - the zip file is downloaded to the response, but it stays in the response and doesn't download as a file.
Here is my code:
[Code]....
Now this works since the file downloads when I use the 'invoke' function when navigating directly to the service.
Here is my jQuery AJAX request...
[Code]....
I added the code in 'beforeSend' so that the request states explicitly what type of response the browser should expect.
I've been using Firebug to monitor the request/response headers and can't see anything wrong with them (except when I look at the content of the response, it's full of binary data AND its the same size as the file I'm sending.
I just attempted to upload screen-dumps of the request/response headers and the content of the reponse but I don't have enough reputation points to do this yet :-(
The Response is the same size of the Zip file so I'm assuming its being sent back to the browser, but the browser doesn't know what to do with it.
Tested in IE, FF & Chrome and the results are consistent.
View 2 Replies
Jan 10, 2010
In classic ASP if you wanted to send a user to a specific page you would send/create a URL like :
posts.asp?id=24 ...the querystring indicating the post.
Well, in asp.net using a DetailsView control bound to a dataset, how do I do the same thing? In the address bar, all i see is posts.aspx when I'm paging through the records, no querystring part. How do I send a user to posts.aspx?id=24 when its a detailsview control on the page.
Note: I'm interested in sending a user to a specific postid not a specific index in the dataset.
View 1 Replies
Sep 16, 2010
Is it possible to control the behaviour of ASP.NET when the Session has expired? It seems that the default behaviour is sending the user to the website root. The desired effect would be to send the user to a custom "Session Expired" page.To clarify, it's the SessionState that's expiring (set the timeout to 1 minute to quickly test it):
<sessionState mode="InProc" timeout="1"></sessionState>
The authentication cookie timeout is way higher, to avoid any mix-up:
<authentication mode="Forms">
<forms loginUrl="SessionExpired.aspx" slidingExpiration="true" name=".ttpASPXAUTH" timeout="58" protection="All"></forms>
</authentication>
View 2 Replies
Dec 20, 2011
How to send email in asp.net just for confirmation for the user registration?
View 7 Replies
Jul 12, 2010
I am developing an application that manages a photo contest. In that application, I use an AsyncFileUpload control for the user selected photo. The server-side UploadedComplete does basic validation, and scales/clip the image as necessary.
The problem is, when i click on the submit button on the page, the content of the AsyncFileUpload gets sent with the other user-submitted data, so the user gets to wait twice as long to get a response from the server (I'm expecting photos that are between 3 and 7 Mb big, which takes a minute or two to upload).
My form looks like that:
<%-- ... snip - all other fields ... -->
<div style="margin-top: 20px; margin-bottom: 5px;">
<span class="texteB"><b>Upload a photo</b></span><br />
Browse your computer to find a photo.</div>
<div>
[Code]....
Is there something I missed out in the documentation? I've been working on this all day without much success.
View 1 Replies
Jan 30, 2010
I've been having a difficult time with this. I have an asp.net page. The user hits the "Run" button and I have code IN AN ASSEMBLY, not in the APP_CODE folder that is called and runs a long process that moves product info from a file into the database. While the user waits, I would like them to see status updates like what product the import process in on and status info. I'm assuming I'd break off into another thread and use Ajax but I have no idea how to do this.
View 4 Replies
May 20, 2010
I am working on document storage and retrieval application. In which i display the pdf document as an png image , but i have a email button on the top. On clicking that the user would be able to provide an email address to which the document needs to be sent, and I need to send this pdf as an attachment. I need to password protect the file for security reasons. I have no clue on how i can do this in asp.net mvc.
View 2 Replies
Aug 31, 2011
I have code that attaches a pdf file and sends out emails to people. It worked fine on my machine. Then deployed it to a client's system and exchange is on another machine. I get the following error message:
Code:
Failure sending mail.
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:25 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at
[Code] ....
Is the user for the nextwork credentials not getting access to the server? Or what could this be normally with the given error message?
View 11 Replies
Apr 27, 2013
I want to add verification of user by sending 6 digit code to his mobile number during registration. Any way how can i do this.
View 1 Replies
May 7, 2015
after i can copy my file to another folder i realised that if this webapplication is used by multiple users at once, then some users are going to get locked out because each one is trying to copy those files.
so how do i tell the user thats trying to use a file to wait untill the file is available.
StreamWriter WriterTotxt = new StreamWriter("date.txt", false);
DateTime LastAccess = File.GetLastWriteTime("path.dbf");
WriterTotxt.Write(LastAccess);
WriterTotxt.Flush();
WriterTotxt.Close();
string ReadTextFile = File.ReadAllText(txtFile);
DateTime test = Convert.ToDateTime(ReadTextFile);
if (File.GetLastWriteTime(LatestUpdatedTime).CompareTo(test) > 0)
{
File.Copy(Path.Combine(sourcefile, fName), Path.Combine(destinationfile, fName), true);
}
View 1 Replies
Sep 22, 2010
The subject of this thread is my question and I am really very sorry, I cannot brief it. I have generated the pdf file which contains text taken as input by various web-form and have saved it in my local drive then sended it to some email addresses. Now I want to know that how can I save it in client computer and send it to some email addresses provided by Client on demand? I am failed to solve this problem as I don't know how to get INFORMATION OF CLIENT'S LOCAL DRIVE AS CLIENT MAY USES DIFFERENT OPERATING SYSTEM.
View 25 Replies