|
Is this error Related with IIS Server or your application ?
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Hello all
In my application i am creating a word document based in user
responses. Now i want to send the document as an attachment with the
mail as soon as the document is created. I want to send email in
background. As soon as document is created i want to send mail
containing document as an attachment.(without using any control)
How can i do this? Please help me to solve..
I am creating document by two ways.
1) StringBuilder class.
2) Exporting datagrid to document.
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
MailMessage mail = new MailMessage();<br />
mail.From = txtFrom.Text;<br />
mail.To = txtTo.Text;<br />
mail.Subject = txtSubject.Text;<br />
mail.Body = txtMsg.Text;<br />
mail.BodyFormat = MailFormat.Html;<br />
mail.Attachments.Add(new MailAttachment(AttacchmentFile));
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
I am creating a word doc using string builder class.
As you mentioned if i write Response.write(strHetmlContent) for
attaching a attachment then it shows a error output can not
produce a value?
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
hi rahuls can you put the line of code where you creating the word file ?
Thanks !!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Hi
Here is that code.
code deleted
When it come to statement Response.Write(strHTMLContent) then a word
document will be generated and in my sendmail function i want to send
this document in the mail as an attachment.
Thanks.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Saturday, March 15, 2008 3:30 AM
|
|
|
|
|
if you write Respose.Write(strHTMLContent) then where the content is going to be store.
better trying to save file temporty and add the file as attachment and delete after sending the mail.
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Content will not be going to store somewhere.
as soon as Respose.Write(strHTMLContent) this code is called
document is generated and it asked to save it on haraddrive.
(like when we are downloading any s/w from net)
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi
This is another code. in that i am displaying all data in grid
and exporting this data to word doc file.
Sub CreateDoc()<br />
Try<br />
<br />
Dim oStringWriter As New System.IO.StringWriter<br />
Dim strFileName As String = "ResultGrid.doc"<br />
Response.Clear()<br />
Response.Buffer = True<br />
'Response.ContentType = "application/vnd.ms-word"<br />
Response.ContentType = "application/vnd.ms-word"<br />
Response.AddHeader("Content-Disposition", "attachment; filename=""" & strFileName & """")<br />
Response.ContentEncoding = System.Text.Encoding.UTF7<br />
Response.Charset = ""<br />
EnableViewState = False<br />
<br />
Dim oHTMLTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)<br />
<br />
DataGrid1.RenderControl(oHTMLTextWriter)<br />
Response.Write(oStringWriter.ToString())<br />
Response.End()<br />
Catch ex As Exception<br />
Response.Write(ex.Message)<br />
End Try<br />
End Sub
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
i am looking on it... if possible delete the last code !!!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Ok
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
yup .... now it looks Good !!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Yes
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I have a list box with some item and Autopost back is true. when i select any one of item first item of list is automaticaly selected. how i can resolve this problem !!
Any idea !
Thanks in Advance !!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Hi
Are you binding dropdownlist data from database if yes then put
you code which you are using for binding in
<br />
if not page.ispostback<br />
'put u r code here<br />
end if<br />
this is happen because whenever you select item in dropdownlist page get refreshed and again dropdownlist is binded from db.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
thanks for reply.
Rahul, if possible recheck the formating of code that where you post your code for word file creation . its totaly destroying the strcuture !!!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Ya its totally destroy structure?
Ok i am posting another code in that code i am generating document
from datagrid. See this in that post. I am editing existing code.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi all
I have a login form(user name and password) that reads its data from a database, I need to check the password textbox letters case, e.g. if the user wrote "admin" it will be different than "ADMIN"...
Is there is any function to do that?
Regards...
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
use Regx !
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
How to do that sir...
Regards
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Hi, I have written a Custom function for that. let me know if it work for you
public bool IsInputMatch(string UserInput, string DataBaseInput)<br />
{<br />
if(Regex.IsMatch(UserInput,DataBaseInput))<br />
return true;<br />
else<br />
return false; <br />
<br />
}
now if you use
if(IsInputMatch("AdMiN", "ADMIN"))<br />
MessageBox.Show("Valid User");<br />
else<br />
MessageBox.Show("InValid User");
Output : InValid User
and for this
if(IsInputMatch("ADMIN", "ADMIN"))<br />
MessageBox.Show("Valid User");<br />
else<br />
MessageBox.Show("InValid User");
Output : Valid User
----
Let me know when done !!! Good luck !!!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Very convenient. You can make a password that matches many different strings...
These all show "true":
MessageBox.Show(IsInputMatch("Anything that you like", ".*"));
MessageBox.Show(IsInputMatch("I mean anything", ".*"));
MessageBox.Show(IsInputMatch("Really whatever you want", ".*"));
MessageBox.Show(IsInputMatch("", "(hello)?"));
MessageBox.Show(IsInputMatch("hello", "(hello)?"));
MessageBox.Show(IsInputMatch("asdf", "...."));
MessageBox.Show(IsInputMatch("1234", "...."));
MessageBox.Show(IsInputMatch("baad", "...."));
MessageBox.Show(IsInputMatch("oops", "...."));
MessageBox.Show(IsInputMatch("1234", "\\d+"));
MessageBox.Show(IsInputMatch("0", "\\d+"));
MessageBox.Show(IsInputMatch("987489792364587634582345983745", "\\d+"));
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Abhijit. The same which i would like to post as my next question........ good nour123... me too need a solution for this... HELP US . - KARAN. can i get a simple example?
|
|
|
|
|
Hi, I have written a Custom function for that. let me know if it work for you
<code>
public bool IsInputMatch(string UserInput, string DataBaseInput)
{
if(Regex.IsMatch(UserInput,DataBaseInput))
return true;
else
return false;
}</code>
now if you use
if(IsInputMatch("AdMiN", "ADMIN"))
MessageBox.Show("Valid User");
else
MessageBox.Show("InValid User");
Output : InValid User
and for this
if(IsInputMatch("ADMIN", "ADMIN"))
MessageBox.Show("Valid User");
else
MessageBox.Show("InValid User");
Output : Valid User
----
Let me know when done !!! Good luck !!!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
THANKS YAAR!
|
|
|
|