Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

How to pass C# variable to HTML code

Does anyone know how to make use of a c# variable in html.

In my C# code i have a variable EmbedTextBox.Text = this.OpenFileDialog;

I want to use that same variable's contents in my HTML code e.g.


which does not work.

is there an easy of doing this?

Saturday, November 6, 2004

Old-fashioned embedded asp tags will do the trick. This assumes the text control is on the same page. If it's a different page, use a relative path, (don't use a server name)

<input type='text' value='<%=EmbedTextBox.Text%>'>

SongSing Writer
Saturday, November 6, 2004

Thank you

Monday, November 8, 2004

*  Recent Topics

*  Fog Creek Home