using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
String FileName = Server.MapPath("Output.txt");
StreamWriter objStreamWriter;
objStreamWriter = File.AppendText(FileName);
//String imagepath = Html32TextWriter.DoubleQuoteChar + "desibindaas.jpg"
//+ Html32TextWriter.DoubleQuoteChar;
String linkPath = Html32TextWriter.DoubleQuoteChar + "http://www.cooltuts.com/" + Html32TextWriter.DoubleQuoteChar;
//objStreamWriter.WriteLine("Sample Test");
//objStreamWriter.WriteLine("<img src=" + imagepath + " width="+600+" alt=" + Html32TextWriter.DoubleQuoteChar
//+ "Emmu Image" + Html32TextWriter.DoubleQuoteChar + " />");
objStreamWriter.WriteLine("<a href=" + linkPath + " >CoolTuts Site</a>");
objStreamWriter.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
String FileName = Server.MapPath("Output.txt");
StreamReader objStreamReader;
objStreamReader = File.OpenText(FileName);
String contents = objStreamReader.ReadToEnd();
Response.Write(contents);
objStreamReader.Close();
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Insert" onclick="Button1_Click" />
<br />
<br />
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="Display" onclick="Button2_Click" />
</div>
</form>
</body>
</html>
ASP Standard Controls
- ASP Label Control
- ASP TextBox Control
- ASP Button Control
- ASP Link Button Control
- ASP ImageButton Control
- ASP HyperLink Control
- ASP DropDownList Control
- ASP ListBox Control
- ASP CheckBox Control
- ASP CheckBoxList Control
- ASP RadioButton Control
- ASP RadioButtonList Control
- ASP Image Control
- ASP ImageMap Control
- ASP Calendar Control
- ASP Table Control
- ASP BulletedList Control
- ASP Hidden Control
- ASP Literal Control
- ASP AdRotator Control
- ASP Panel Control
- ASP PlaceHolder Control
- ASP FileUpload Control
- ASP UserControl
- ASP Custom Control
Random Tips and Tricks
Wednesday, September 8, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment