473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

correct syntax to exclude tags

Hi,

I need to exclude a control tag from an aspx page depending on the
availability of a session variable.I try to enclose it in an if bloack
as follows, but it seems to be not working.

<% If Session("MySessionVariable") <"" Then%>
<MyUserCtrl:MyObj id="SearchResultNav" runat="server"></
MyUserCtrl:MyObj>
<% End If%>
simply, I do not want the usercontrol tag to be included on the page
if the session variable is not set.

thanks.

Apr 25 '07 #1
1 940
It seems that you're thinking in Classic ASP terms here. How about using
the codebehind file to control whether or not it's visible.

codebehind:

SearchResultNav.Visible = Session("MyVariable") <""

Ray at work
"Aamir Ghanchi" <aa**********@gmail.comwrote in message
news:11**********************@b40g2000prd.googlegr oups.com...
Hi,

I need to exclude a control tag from an aspx page depending on the
availability of a session variable.I try to enclose it in an if bloack
as follows, but it seems to be not working.

<% If Session("MySessionVariable") <"" Then%>
<MyUserCtrl:MyObj id="SearchResultNav" runat="server"></
MyUserCtrl:MyObj>
<% End If%>
simply, I do not want the usercontrol tag to be included on the page
if the session variable is not set.

thanks.
Apr 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Han | last post by:
Yet another newbie regular expression question (I swear, I'm learning!) I have a simple pattern that captures an anchor tag: (<a.*?</a>) It works great. I would now like to modify this to...
0
by: deplexus | last post by:
Hi i have query SELECT * FROM stat WHERE host LIKE "uncp%" AND remotehost NOT REGEXP "looksmart" AND datetime REGEXP '^........17.*'; and it works as have to but when i try to complicate:
0
by: Philip Meyer | last post by:
1) setting image as Background with alignment in center not working..help Explanation : i need to set a image as background and also it should be dispalyed in the center.i am using apache fop...
1
by: kmunderwood | last post by:
I have an xml file that I get "As Is" (at bottom of post) I want to sort and exclude some elements, and turn other child elements red, or its background. I want it to look like this: Tank ...
8
by: Ike | last post by:
I am hoping someone can help me with the proper syntax for this. I have an attribute, called, say "name," such that: <set name="something">thename</set> However, the value for name, is...
17
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
2
by: Dan Schumm | last post by:
I'm relatively new to regular expressions and was looking for some help on a problem that I need to solve. Basically, given an HTML string, I need to highlight certain words within the text of the...
5
by: Diego Pino | last post by:
Hello, I am experience some problems reading a form variable from a Javascript function. The point with this particular variable is that its name has the following syntax: <input...
8
by: banderson | last post by:
Hello, I have a combo box in which I want to display multiple fields by concatenating the fields together. If one of those concatenated fields is Null, then the combo box does not show anything. To...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.