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

C# to VB: specific issue

Hello,

Normally automatic converters do a very good job at translating code between
C# and VB

I have a specific issue however that I can not solve using these converters
.... and I just can not figure out how to do it myself.
The line that causes problem is:
:
<%# ((AuthorizationRule) Container.DataItem).Action %>

It is used in the context below:

<asp:datalist id="DL_Rules" runat="server">
<itemtemplate>
Action: <asp:literal id="Literal1" runat="server"
text='<%# ((AuthorizationRule)
Container.DataItem).Action %>'/>
<itemtemplate><%# Container.DataItem %></itemtemplate>
<separatortemplate>-</separatortemplate>
</asp:repeater>
</itemtemplate>
</asp:datalist>

The source of this code is
http://www.akaas.net/asp-net-2-tutorial/Chap13.htm

Thanks in advance for your support,

Michel
Jul 6 '07 #1
2 1305
Michael

The VB syntax for that line is:

<%# Ctype(Container.DataItem, AuthorizationRule).Action %>

The type name in parenthesis before the object is C# syntax for
casting.

Hope this helps

Tom

On Fri, 6 Jul 2007 17:01:23 +0200, "Michel Couche"
<Co*****@MichelCouche.netwrote:
>Hello,

Normally automatic converters do a very good job at translating code between
C# and VB

I have a specific issue however that I can not solve using these converters
... and I just can not figure out how to do it myself.
The line that causes problem is:
:
<%# ((AuthorizationRule) Container.DataItem).Action %>

It is used in the context below:

<asp:datalist id="DL_Rules" runat="server">
<itemtemplate>
Action: <asp:literal id="Literal1" runat="server"
text='<%# ((AuthorizationRule)
Container.DataItem).Action %>'/>
<itemtemplate><%# Container.DataItem %></itemtemplate>
<separatortemplate>-</separatortemplate>
</asp:repeater>
</itemtemplate>
</asp:datalist>

The source of this code is
http://www.akaas.net/asp-net-2-tutorial/Chap13.htm

Thanks in advance for your support,

Michel
Jul 6 '07 #2
"Michel Couche" <Co*****@MichelCouche.netwrote in message
news:ez**************@TK2MSFTNGP05.phx.gbl...
<%# ((AuthorizationRule) Container.DataItem).Action %>
<%# Ctype(Container.DataItem, AuthorizationRule).Action %>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 6 '07 #3

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

Similar topics

6
by: Tony C | last post by:
I'm writing a python program which uses regular expressions, but I'm totally new to regexps. I've got Kuchling's "Regexp HOWTO", "Mastering Regular Expresions" by Oreilly, and have access to...
1
by: Laurence Nixon | last post by:
Hello all. I am seeking ideas on how to determin a specific value with varied parameters. This will be for students who have taken modules in a course for pre-certification. So it will be like...
1
by: msmith | last post by:
MSSQL Server 2000 SP3 in both houston and memphis I have a database in houston, lets call it RED. Specific tables from database RED are copied to database BLUE. Database BLUE is then backed...
0
by: Dan | last post by:
Issue making textbox visible based on specific input from a radio button list in an EditItemTemplate I want to setup a gridview that when in edit mode and when the user selects "Other" from a...
1
by: Abdulla Herzallah | last post by:
Hi everyone I don't know if I am posting this to the right newsgroup but it is the closest I found, in case you think you can advice me to another newsgroup please feel free to do so. I am so...
3
by: Abdulla Herzallah | last post by:
Hi everyone I don't know if I am posting this to the right newsgroup but it is the closest I found, in case you think you can advice me to another newsgroup please feel free to do so. I am so...
1
by: Dutt | last post by:
Hi All, Now I have some other question. Our application installs DB2 Express Edition C V9.0 and then restores the master database. But there are other lower versions of DB2 in the client...
1
by: jborg | last post by:
I have a method to send PHP array values via Ajax to another PHP file that processes my request, however I cannot get it to work here. I know this is normally a basic and very general error, but...
10
by: Jan Vinten | last post by:
Hi all, I got into some trouble trying to bind to a specific IP address. Code: Private mobjClient As TcpClient mobjClient = New TcpClient(IPAddress.Parse("10.16.104.87").ToString, 8892)
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...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.