473,774 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling public shared function from a datagrid template column

isn't it possible to call a public shared function that resides in
another file directly from the datagrid html code?:

<asp:TemplateCo lumn HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server"
Text='<%# DecryptString(D ataBinder.Eval( Container,
"DataItem.Passw ord")) %>' />
</ItemTemplate>

Currently I have a DecryptString in the code behind the datagrid. This
function simply calls the same public shared function.

Nov 19 '05 #1
4 2395
Sure. Just call it!

You'll need to specify the namespace and class like normal:

<%# Utility.Decrypt String(...) %>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"hansiman" <ha***@hotmail. com> wrote in message
news:jq******** *************** *********@4ax.c om...
isn't it possible to call a public shared function that resides in
another file directly from the datagrid html code?:

<asp:TemplateCo lumn HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server"
Text='<%# DecryptString(D ataBinder.Eval( Container,
"DataItem.Passw ord")) %>' />
</ItemTemplate>

Currently I have a DecryptString in the code behind the datagrid. This
function simply calls the same public shared function.

Nov 19 '05 #2
I tried this and it gives me the following error

Compiler Error Message: BC30451: Name 'Utility' is not declared.

Source Error:
Line 71: <asp:TemplateCo lumn HeaderText="Pas sword">
Line 72: <ItemTemplate >
Line 73: <asp:Label runat="server" Text='<%#
Utility.Decrypt String(DataBind er.Eval(Contain er, "DataItem.Passw ord"))
%>' />
Line 74: </ItemTemplate>
Line 75: <EditItemTempla te>
On Mon, 18 Jul 2005 07:38:42 -0400, "Karl Seguin" <karl REMOVE @
REMOVE openmymind REMOVEMETOO . ANDME net> wrote:
Sure. Just call it!

You'll need to specify the namespace and class like normal:

<%# Utility.Decrypt String(...) %>

Karl


Nov 19 '05 #3
Is utility the actual name of the class?

Is it in the same namespace as the page? If not, you need to qualify the
class name either via an @Import or via
SomeNamespace.U tility.DecryptS tring...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"hansiman" <ha***@hotmail. com> wrote in message
news:n3******** *************** *********@4ax.c om...
I tried this and it gives me the following error

Compiler Error Message: BC30451: Name 'Utility' is not declared.

Source Error:
Line 71: <asp:TemplateCo lumn HeaderText="Pas sword">
Line 72: <ItemTemplate >
Line 73: <asp:Label runat="server" Text='<%#
Utility.Decrypt String(DataBind er.Eval(Contain er, "DataItem.Passw ord"))
%>' />
Line 74: </ItemTemplate>
Line 75: <EditItemTempla te>
On Mon, 18 Jul 2005 07:38:42 -0400, "Karl Seguin" <karl REMOVE @
REMOVE openmymind REMOVEMETOO . ANDME net> wrote:
Sure. Just call it!

You'll need to specify the namespace and class like normal:

<%# Utility.Decrypt String(...) %>

Karl

Nov 19 '05 #4
thanks.

I wasn't aware that I could include
<%@ Import Namespace="
directly in the html file.

On Mon, 18 Jul 2005 09:30:27 -0400, "Karl Seguin" <karl REMOVE @
REMOVE openmymind REMOVEMETOO . ANDME net> wrote:
Is utility the actual name of the class?

Is it in the same namespace as the page? If not, you need to qualify the
class name either via an @Import or via
SomeNamespace. Utility.Decrypt String...

Karl


Nov 19 '05 #5

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

Similar topics

2
5445
by: jez123456 | last post by:
Hi. I have a web form with a datagrid that displays employees who are on holiday. One of the datagrid columns shows the date of their last day of holiday, but what I really require is the Start Back at work date, i.e. if their last day of holiday is a Friday, then the Start Back date should be the following Monday (ignoring any weekends and public holiday dates). I have a table which holds the national holiday dates (tblUKHolidays), but how...
4
1798
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns when the Edit button is pressed? Thank you, Stephan.
1
1495
by: RN | last post by:
Hi. I used this article to add a template column to a datagrid that is entirely created with code: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskcreatingtemplatesprogrammaticallyindatagridcontrol.asp It works fine except for one thing. My template column needs a field in the recordset that binds to the datagrid. The template column is an HTML radio button where the value of the radio button needs...
2
2152
by: tshad | last post by:
Is there a way to call a function from a boundcolumn tag? I have some icons that I set as visible or not depending on values set in my table. I have a Datagrid that I am binding to and after binding I then go through the DataGrid item by item checking the values and setting the icons accordingly. If I could set them via a function during binding would be better.
1
1878
by: Ken Varn | last post by:
I have a problem where my DataGrid would not maintain the ViewState of my databound rows. I finally narrowed down the problem. If my first column is a template column, the view state for the DataGrid items is not maintained on postback for some reason. I basically re-created my DataGrid again just to make sure this was indeed the problem. The ViewState was fine until I added the template column at the beginning of the Columns list. ...
1
1176
by: jmhmaine | last post by:
I'm converting C# code to VB.Net and I completed everything but a couple lines. I'm receiving an error Calling Public Event directly. Here is the relevant code: Public Class DataGridButtonColumns Inherits DataGridTextBoxColumn Public Event CellButtonClicked As DataGridCellButtonClickEventHandler Private _button As Bitmap
8
3896
by: Matt | last post by:
Guys I could really use some help with this. I think that it's probably a simple solution but I haven't been able to find anything. I have a datagrid on my form that I populate via code like this... Me.My_DataGrid.Rows.Add(Column1, Column2, Column3) Well now I have a datagrid that I want to populate with an image. So for example...
2
3485
by: johnlim20088 | last post by:
Hi Can anyone help me? I have a Javascript function in my test.aspx as follow:- <script language="Javascript"> function confirm_save() { if (confirm("Are you sure you want to save this changed?")==true) return true;
8
12621
by: Jeff | last post by:
Still new to vb.net in VS2005 web developer... What is the proper/standard way of doing the following - setting the value of a variable in one sub and calling it from another? E.g., as below. The code below draws an error as indicated. Surely there has to be a better way than to make xxx a session variable? Thanks
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.