|
public static bool SendMail(string From, string To, string Subject, string Body)
{
try
{
string FileName = @"c:\text.pdf";
MailMessage message = new MailMessage();
message.From = new MailAddress(From);
message.To.Add(new MailAddress(To));
message.Subject = Subject;
message.Body = Body;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("192.168.1.231");
if (FileName != null)
message.Attachments.Add(new System.Net.Mail.Attachment(FileName));
smtp.Send(message);
return true;
}
catch
{
return false;
}
}
|
|
|
|
|
Check out my Article entitled Save an XML File to database and send an email using XSLT
it kind of touches on this and has some code for you to look at
|
|
|
|
|
hai sir/mam
When i close the internet explorer ..want to delete mytable records.....please help me
A.Rajapandian
|
|
|
|
|
u can write ur code in onunload
|
|
|
|
|
in calender_render event, i control the days as:
if (e.Day.isOtherMonth) e.Cell = " "; (sth like that)
so users cant deal with the day of other months.. but when i turn selectmode from day to dayweek, the weeks of other months are seen too..
when calendar is like behind, there is no problem;
- - - - 1 2 3
4 5 6 7 8 9 10
.
.
.
31 - - - - - -
but sometimes it is like
- 1 2 3 4 5 6
7 8 9 10 11 12 13
.
.
28 29 30 31 - - -
- - - - - - -
"-" means, this day is not visible, not clickable..
when selectmode is day, we can see the days of prev or next month.. i hide it.. these days are in the same row with the days of current month, so it is not a problem to see that row..
but if selectmode is weekday, we can see te prev or next week of other months.. there is no day from current day in the row, so there is a empty row.. i want to hide this row too..
other month days are not clickable, those cells are empty and user cant reach.. but when user click on week,, user can select a empty row, even user cant select those days by clickingh on them, he can select them by clicking the week column..
there are 10 types of people in the world, those who understand binary numbers and those who dont..
|
|
|
|
|
Hello
I have a web page with different parts. In some parts of it, user can change the data of that. I put a button to save the data of each part, separately.
The user can enter new data without saving them. But I want to show a message to save them. The message should be shown when user closes the window or click some links.
This message should be shown client side. I know the command window.alert(...). I do not know in which JavaScript event I should show that to support every option of page transfer.
Please instruct me or offer me a different way.
Thanks
Rastgar
|
|
|
|
|
either <body onbeforeunload="functionName()" >
or <body onunload="functionName()" >
function functionName()
{
alert('pls save');
window.event.returnValue = false;
window.event.cancelBubble=true;
}
|
|
|
|
|
Thanks for your help.
Your code works very well. But when i use it, after alert 'pls save', I have another alert:
"Are you sure you want to navigate away from this page?
false
Press ok to continue, or cancel to stay on the current page."
it happens after code:
"window.event.returnValue = false;"
I don't want this alert to be shown. What should I do?
Thanks
Rastgar
|
|
|
|
|
Not possible to stop browser to close in JS. So u have to go with that extra alert.
|
|
|
|
|
Hi all,
I made a button in a masterpage and it works correctly when clicked.I want to know if there is any way to submite this button by pressing Enter from keyboard,because what happens is that the page is posted without submitting the button because it's not in the same page.
thanx
|
|
|
|
|
It is on the same page. The master page and the content page together form a web page. When the page reaches the browser, it's just a single page.
Make sure that the button is the first button in the code of the form, and enter will work so submit it.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
hi guys
I am stuck in one problem please help me......I need to open any file (wordfile,pdf document etc...) from gridview. I have path for that file and i am getting that path but it is not being open. I tried hyperlinkfield and templatefield but in both case it is not done. So tell me some other way
Regards,
DJ Rock
|
|
|
|
|
hi.
WOTS A PROBLEM WITH HYPERLINK FIELD?
U CAN DO THAT USING HYPERLINK
JUST PASS FILE PATH TO NAVIGATIONURL
PATHAN
|
|
|
|
|
thanks for reply
i am doing the same but my path is coming from database, so i am passing Eval("Path") to which is not working. If you have code then please let me know
Thanks again
Regards,
DJ Rock
|
|
|
|
|
use DataBinder.Eval(Container.DataItem, "path")
pathan
|
|
|
|
|
i need to put a button on my web form to show the calculator for the user to do some calculations
abdelhameed81
|
|
|
|
|
|
i want to knw how to do it
|
|
|
|
|
My Guess is that you would have to write some client side javascript that will some how get access to the client side calculator? Although this can be quite tricky.
I don't think you'll be able to do this using server side code.
Another way to do it is to write your own asp.net calculator that you can pop up when required.
|
|
|
|
|
Function test
Dim t
Set t = CreateObject("WScript.Shell")
t.Run "notepad.exe",1,True
set t = nothing
End Function
|
|
|
|
|
Hi
I'm using an ASP.NET 1.1 page where I render a complex HTML form on the fly through javascript. Now before posting I copy the entire outerHTML of my form (inside div tag) and post is back to the server for processing. My requirement is like that only and I do not want to copy the form's HTML to some other frame and then request it back once page is loaded after posting.
The solution works perfectly fine on my development environment where I use Windows 2000, IIS 5.0 to host the application and Windows XP SP and IE6 to access the application. But when I installed the application on my client's environment (Windows 2000 server, IIS 5.0) and access it from another machine on the same domain (IE6.0 and IE 7, different machines), it gives me "Action Cancelled" or "Page cannot be displayed" error message once I post the form.
To my surprise, this does not happen when I run the web application on the web server's browser. I have increased maxRequestLength in web.config. I've also implemented the solution suggested in http://www.kbalertz.com/327659/receive.error.request.upload.large.Internet.Information.Services.aspx
Further, my client allowed me to bring their server (the same one where I get "Action cancelled" after accessing it from another browser). When I joined the server on my domain, it WORKED!!! This means I can post large form data from other client's browser (in the same domain).
To test whether this error is due to some other factor, I created a small aspx form with a File Upload component. In the different scenarios as stated above, even this fails when I try upload a 400 KB file (only on client's network, and accessing from a browser that is in the network and not the web server machine).
Clearly this has got something to do with either some watchdog software running on my client's network or their workstations. I don't think we configure that in IE7?? I also checked uploaded a file attachment to my hotmail a/c on the troubled workstation. Sadly, it works but not with my piece of code.
Your help will be greatly appreciated.
Thanks,
Vishal Seth
Base77
|
|
|
|
|
i have created a website but i am facing problem to create option "remember password on same computer"
if anyone have idea or code to use the same option please send me.
thank you!!!
contact me: ashish.0619@gmail.com
|
|
|
|
|
|
Please don't cross post.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
create a cookie for the user name and password...
once u logged in u will store the value in the value..
relogin check for cookie value if it present then without asking validate the user name and password.
i think this work for u.
|
|
|
|