473,396 Members | 1,789 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,396 software developers and data experts.

Using inline code

Bob Ross
119 100+
Can anyone point me in the direction of a good article or somewhere I can learn more about inline code?

I am trying to set a links text and visibility without using the code behind file like this -
<asp:HyperLink ID="OrdersMaintenanceLink"
runat="server"
Text='<%# TranslateTag("vbeiTest") %>'
NavigateUrl="~/SE/Orders/ManageCustomerServices.aspx"
Visible='<%# CurrentOperator.IsClient = "True" %>'
CssClass="StandaloneLinks" />

But this doesn't work and I don't know why?
Jul 23 '08 #1
6 1230
Plater
7,872 Expert 4TB
What are you trying to accomplish with this:
Expand|Select|Wrap|Line Numbers
  1. Visible='<%# CurrentOperator.IsClient = "True" %>'
  2.  
Are you trying to do a comparison?
Wouldn't that be ==?
Jul 23 '08 #2
Bob Ross
119 100+
I would like the hyperlink to be visbile or not depending on the IsClient property of the currentOperator object.

A single '=' is used for comparison in vb.net. a double '==' throws an error.
Jul 24 '08 #3
Plater
7,872 Expert 4TB
isClient is a string and not a boolean? If it were a boolean you could just use it's .ToString() property?


I have used this successfully (Note the %= and not %#)
Expand|Select|Wrap|Line Numbers
  1. <div id="SWA" class="SWA" style="<%=GlobalVars.SWAStyle %>" >
  2.  
Jul 24 '08 #4
Bob Ross
119 100+
No IsClient is a boolean property of the CurrentOperator object.

I tried -
Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:HyperLink ID="OrdersMaintenanceLink" 
  3. runat="server" 
  4. Text="vbeiOrdersMaintenance" 
  5. NavigateUrl="~/SE/Orders/ManageCustomerServices.aspx" Visible='<%=CurrentOperator.IsClient%>' 
  6. CssClass="StandaloneLinks" />
  7.  
But to no avail.

Anyone know any good resources I can read up on inline code?
Jul 25 '08 #5
Bob Ross
119 100+
According to this article it is not possible to edit a controls properties using the <% %> tags. These can only be used at the top page level (i.e outside of controls).

There is however a work around.

Plater how did you get it to work?
Jul 25 '08 #6
Plater
7,872 Expert 4TB
Ah ah ah!
"Visible" is an ASP.NET attribute, not the html attribute.
I had mine on a plain HTML element (a DIV) so it did not try to validate attributes for the ASP.NET object.
Jul 28 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Chris Mantoulidis | last post by:
I am not clear with the use of the keyword inline... I believe you add it do a function when you implement the function inside the header file where the class is stored... But is that all? What...
6
by: RainBow | last post by:
Greetings!! I introduced the so-called "thin-template" pattern for controlling the code bloat caused due to template usage. However, one of the functions in the template happens to be virtual...
18
by: Method Man | last post by:
If I don't care about the size of my executable or compile time, is there any reason why I wouldn't want to inline every function in my code to make the program run more efficient?
6
by: Anders M | last post by:
I'm trying to use Inline-code to call Page_load, Page_Init or Page_PreRender methods. I've also got a code behind c#-file. I can define inline methods for buttons and so on...that works fine....
9
by: chinu | last post by:
hi all, i did a small experiment to grasp the advantages of declaring a function as inline. inline int fun1(); int main(){ unsigned int start=0,end=0; asm("rdtsc\n\t"
15
by: niklaus | last post by:
Hi, I have a doubt regarding inline functions. 1) When does the inline of function happen. During the preprocessing stage or just before the object code is produced. Can we see the source code...
5
by: Gianni Mariani | last post by:
I'm hoping someone can tell me why using member address of works and why using the dot operator does not in the code below. The code below uses the template function resolution mechanism to...
7
by: sidewinder | last post by:
I wish to use a C++ vector class, which I have taken from the book numerical recipes. However due to the nature of the calculations I wish to perform I need to be able to delete the vectors. I...
2
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.