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.

<html><value=mms://server/EmbedTextBox.Text></html>

which does not work.

is there an easy of doing this?

Zindagi
Saturday, November 06, 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 06, 2004

Thank you

Zindagi
Monday, November 08, 2004

*  Recent Topics

*  Fog Creek Home