ASP.Net page to HMTL Conversion

Convert aspx page to html

Page 1 of 1

2 Replies - 1368 Views - Last Post: 22 March 2009 - 07:54 AM Rate Topic: -----

#1 AmritaKripa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-March 09

ASP.Net page to HMTL Conversion

Posted 20 March 2009 - 02:10 AM

I have an asp.net page which has a button. On click of that button, I want to convert this asp.net page to html. On using the code i have, i am getting the html . But i am also getting the button in the generated html page. I don't want that to happen.To be specific, I don't want that button to be copied to the html that is generated. Can anybody help me???
Its really urgent.Here is the code i used to generate the html from aspx page
WebRequest myRequest = WebRequest.Create("http://localhost:11335/Convert-asptohtml-2/Dups.aspx");
	   
		//Return the response. 

		WebResponse myResponse = myRequest.GetResponse();


		//Obtain a 'Stream' object associated with the response object.

		Stream ReceiveStream = myResponse.GetResponseStream();

		Encoding encode = System.Text.Encoding.GetEncoding("utf-8");


	  //Pipe the stream to a higher level stream reader with the required encoding format. 
	   StreamReader readStream = new StreamReader(ReceiveStream, encode);


		//Read 256 charcters at a time.	

		Char[] read = new Char[256];

		int count = readStream.Read(read, 0, 256);

		String str1 = "";
		using (StreamWriter sw = new StreamWriter("MyPage.htm"))
		{
		   
			while (count > 0)
			{

				// Dump the 256 characters on a string and display the string onto the console.

				str1 = new String(read, 0, count);
				sw.Write(str1);
				count = readStream.Read(read, 0, 256);


			}

		}
	
		 // Close the response to free resources.

		myResponse.Close();


Is This A Good Question/Topic? 0
  • +

Replies To: ASP.Net page to HMTL Conversion

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: ASP.Net page to HMTL Conversion

Posted 20 March 2009 - 03:25 AM

HTML will be generated for any control that is visible. There is nothing you can do about that.
Was This Post Helpful? 0
  • +
  • -

#3 kansascoder  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 9
  • Joined: 22-March 09

Re: ASP.Net page to HMTL Conversion

Posted 22 March 2009 - 07:54 AM

Can you set visible=false on that button at the start of your process?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1