sent data from asp page to notepad

Posted by Sai_sudha under JavaScript on 10/8/2009 | Views : 2103 | Status : [Member] | Replies : 2
Hi,

I am having a asp registration page when i click submit button i want
to display values in notepad using javascript




Responses

Posted by: Vuyiswamb on: 10/9/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Sai_sudha

You mean you want to save the inputed details from your asp.net page to a Notepad?

If yes use io class to write to Files. see the link below

http://www.csharphelp.com/archives4/archive673.html


http://www.csharphelp.com/archives2/archive363.html

http://ondotnet.com/pub/a/dotnet/2002/08/05/io.html

http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=400

Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sai_sudha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Niradhip on: 10/10/2009 [Member] Starter

Up
0
Down
You can also use pagebehind to accomplish this tusk.



Create a textfile inside your application say "Log.txt";



System
.IO.StreamWriter objWriter;//Declare this as public.

string LOG_FILE_NAME; //Declare this as public.



protected void Page_Load(object sender, EventArgs e)

{

LOG_FILE_NAME = Server.MapPath("Log.txt");

}







string strMessage ="";//put your message here

WriteLogMessage (strMessage);



public void WriteLogMessage(string strMessage)

{

try

{

if (System.IO.File.Exists(LOG_FILE_NAME) == true)

{

objWriter = System.IO.File.AppendText(LOG_FILE_NAME);

}

else

{

objWriter = System.IO.File.CreateText(LOG_FILE_NAME);

}



objWriter.Write(strMessage + Environment.NewLine);

}



catch (Exception ex)

{

}

finally

{

objWriter.Flush();

objWriter.Close();

}

}


Sai_sudha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response