C
ciccone1978
Hi,
Can someone help me?
I'm writing a simple web page with ASP.NET 1.1 using code-behind
technique.
Now, depending on the value of a variable declared in the code, I want
to hide/show an html
tag <a href=...></a> but actually I don't know how to do that.
I've thought to use mixed inline/code-behind in my asp page but if
I've set-up my variable
in the code-behind "myVar = MyFunc();" can I use it in the inline-code
too?
To summarize:
1) in the code-behind:
private void Page_Load(object sender, System.EventArgs e)
{
string myVar = MyFunc(); //I'm going to use this variable in other
points.
}
2) and in the inline-code
<%if(myVar=="XX") <a href=...></a>%>
But that doesn't work.
Yes, I can call the function in the inline too but it's a little heavy
or maybe I can use cache but here I've some doubts,
when the asp.page is loading which step is executed first 1) or 2)?
Some ideas?
Thanks in advance!
Bye.
Can someone help me?
I'm writing a simple web page with ASP.NET 1.1 using code-behind
technique.
Now, depending on the value of a variable declared in the code, I want
to hide/show an html
tag <a href=...></a> but actually I don't know how to do that.
I've thought to use mixed inline/code-behind in my asp page but if
I've set-up my variable
in the code-behind "myVar = MyFunc();" can I use it in the inline-code
too?
To summarize:
1) in the code-behind:
private void Page_Load(object sender, System.EventArgs e)
{
string myVar = MyFunc(); //I'm going to use this variable in other
points.
}
2) and in the inline-code
<%if(myVar=="XX") <a href=...></a>%>
But that doesn't work.
Yes, I can call the function in the inline too but it's a little heavy
or maybe I can use cache but here I've some doubts,
when the asp.page is loading which step is executed first 1) or 2)?
Some ideas?
Thanks in advance!
Bye.