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

Call / Embed Method in ASPX

quick question:

I need to call a method from within my ASPX file. What is the syntax? What I
have isn't working.

<asp:HyperLink ID="HyperLink98" runat="server" NavigateUrl='<%= GetUrl()
%>'>Back to Summary1</asp:HyperLink>

in my cs file:
protected string GetUrl()
{

return "This is a test";

}

thanks:
May 8 '06 #1
2 1099
If this isn't happening during a databound operation, you typically set it
in codebehind.

HyperLink98.NavigateUrl = GetUrl();
Karl

--
http://www.openmymind.net/

"Andrew Robinson" <ne****@nospam.nospam> wrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
quick question:

I need to call a method from within my ASPX file. What is the syntax? What
I have isn't working.

<asp:HyperLink ID="HyperLink98" runat="server" NavigateUrl='<%= GetUrl()
%>'>Back to Summary1</asp:HyperLink>

in my cs file:
protected string GetUrl()
{

return "This is a test";

}

thanks:

May 8 '06 #2
Hi Andrew,

Thanks for your posting.

The <%= construct can only be used in client script for write some value
from server. The hyperlink control is run at server side.

You can use the <%# construct if it's happening during a databound
operation.

Regards,

Walter Wang
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 10 '06 #3

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

Similar topics

2
by: François de Dardel | last post by:
Please don't scream that EMBED is evil ! What I am doing is <EMBED SRC="BWV659.mid" AUTOSTART="false" LOOP="TRUE" CONTROLS="SMALLCONSOLE" WIDTH="50" HEIGHT="15" TITLE="BWV 659"> Note the...
2
by: Cris Curtis | last post by:
When I use an embed tag that uses a dynamic aspx page, the dynamic aspx page appears to get called 2 times instead. Below is code that adds an embed tag to a placeholder control that will use...
2
by: Jay | last post by:
Is it possible to use the <% %> tag to embed a variable from page_load into a meta tag in the aspx source? Somehow I am not getting the value out of my variable properly - probably not using...
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...
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...

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.