using backend variables in html code
-
hello everyone - I want to know how I can use my variable from the backend code in the designer code for a page. I have a url, and I want to attach a variable to it, something like this:
You mean you want to add a variable or a script. ?? If you want a variable.. you need to write using
<% %>
tag. Just like :<%= this.MyText %>
(provided MyText is a class level variable with atleast protected access specifier is applied). On the other hand if this is a script, in Page_Load usestring scriptelement = "if (document.all||window...."; //your script
if(!this.ClientScript.IsClientScriptBlockRegistered("myscript"))
this.ClientScript.RegisterStartupScript(this.GetType(), "myscript", scriptelement, true);:-D :rose:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.