Click here to Skip to main content
16,021,004 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to extract links from a webpage using mshtml Pin
Stephane Rodriguez.7-May-03 20:37
Stephane Rodriguez.7-May-03 20:37 
GeneralRe: How to extract links from a webpage using mshtml Pin
benzite7-May-03 21:41
benzite7-May-03 21:41 
GeneralRe: How to extract links from a webpage using mshtml Pin
Stephane Rodriguez.7-May-03 21:58
Stephane Rodriguez.7-May-03 21:58 
GeneralRe: How to extract links from a webpage using mshtml Pin
benzite7-May-03 22:25
benzite7-May-03 22:25 
AnswerRe: How to extract links from a webpage using mshtml Pin
Stephane Rodriguez.6-May-03 22:36
Stephane Rodriguez.6-May-03 22:36 
General<mailto> in C# Pin
eggie56-May-03 15:02
eggie56-May-03 15:02 
GeneralRe: in C# Pin
J. Dunlap6-May-03 15:35
J. Dunlap6-May-03 15:35 
GeneralAll in Code Behind. . . . Pin
drewpecunia6-May-03 13:38
drewpecunia6-May-03 13:38 
Poke tongue | ;-P
I wanted to build a page all in code behind so that I could learn how this is done in C#. So I tried by developing below and calling from an aspx page. It compiles fine but I just get a blank page. Does anyone have any thoughts on what is wrong?
using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public class myPage: Page
{
public System.Web.UI.WebControls.TextBox txtTextBox;
public System.Web.UI.WebControls.Label lblLabel;

public void CreateChildControls(HtmlTextWriter stringWriter)
{

// Use htmlWriter to write HTML.
string strOpenHTML;
strOpenHTML = "<title>My Page";
strOpenHTML += "Enter some text:";
this.Controls.Add( new LiteralControl( strOpenHTML ) );

// Add HTMLForm Tag
HtmlForm frmForm = new HtmlForm();
frmForm.ID = "myForm";
Controls.Add( frmForm );


// Add a TextBox
txtTextBox.ID = "myTextBox";
frmForm.Controls.Add( txtTextBox );

// Add a Button
Button btnButton = new Button();
btnButton.Text = "Click Here!";

//AddHandler btnButton.Click, AddressOf Button_Click;
btnButton.Click += new EventHandler(Button_Click);
frmForm.Controls.Add( btnButton );
btnButton.Text = "Click Here!";
frmForm.Controls.Add( btnButton );

// Add Page Break
frmForm.Controls.Add( new LiteralControl( "

" ) );

// Add a Label
lblLabel.ID = "myLabel";
frmForm.Controls.Add( lblLabel );

// Add Closing HTML Tags
string strCloseHTML;
strCloseHTML = "";
Controls.Add( new LiteralControl( strCloseHTML ) );
}

void Button_Click( object s, EventArgs e )
{
lblLabel.Text = txtTextBox.Text;
}
}


Code to Live Live to Code


GeneralWebRequest is not working Pin
IsaacB6-May-03 12:48
IsaacB6-May-03 12:48 
GeneralRe: WebRequest is not working Pin
leppie7-May-03 7:01
leppie7-May-03 7:01 
GeneralNetworkStream: To buffer, or not to buffer... Pin
Katalyst6-May-03 12:14
Katalyst6-May-03 12:14 
QuestionIHTMLEditHost sample for C#? Pin
J. Dunlap6-May-03 10:22
J. Dunlap6-May-03 10:22 
AnswerRe: IHTMLEditHost sample for C#? Pin
Stephane Rodriguez.6-May-03 11:30
Stephane Rodriguez.6-May-03 11:30 
GeneralRe: IHTMLEditHost sample for C#? Pin
J. Dunlap6-May-03 13:01
J. Dunlap6-May-03 13:01 
QuestionHow to get the IP Number of the server on which my app is running Pin
Ranjan Banerji6-May-03 9:20
Ranjan Banerji6-May-03 9:20 
AnswerRe: How to get the IP Number of the server on which my app is running Pin
Rama Krishna Vavilala6-May-03 9:31
Rama Krishna Vavilala6-May-03 9:31 
GeneralRe: How to get the IP Number of the server on which my app is running Pin
Ranjan Banerji6-May-03 9:54
Ranjan Banerji6-May-03 9:54 
GeneralRe: How to get the IP Number of the server on which my app is running Pin
Ranjan Banerji6-May-03 10:24
Ranjan Banerji6-May-03 10:24 
AnswerRe: How to get the IP Number of the server on which my app is running Pin
Vasudevan Deepak Kumar7-May-03 1:54
Vasudevan Deepak Kumar7-May-03 1:54 
GeneralRe: How to get the IP Number of the server on which my app is running Pin
Ranjan Banerji7-May-03 3:45
Ranjan Banerji7-May-03 3:45 
GeneralRe: How to get the IP Number of the server on which my app is running Pin
Vasudevan Deepak Kumar7-May-03 3:59
Vasudevan Deepak Kumar7-May-03 3:59 
GeneralRe: How to get the IP Number of the server on which my app is running Pin
Ranjan Banerji7-May-03 11:17
Ranjan Banerji7-May-03 11:17 
GeneralForm Design Quandries Pin
RB@Emphasys6-May-03 7:54
RB@Emphasys6-May-03 7:54 
GeneralRe: Form Design Quandries Pin
Stephane Rodriguez.6-May-03 9:07
Stephane Rodriguez.6-May-03 9:07 
GeneralRe: Form Design Quandries Pin
RB@Emphasys6-May-03 9:12
RB@Emphasys6-May-03 9:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.