ASPNet HyperLink NavigateUrl question

J

Jason Huang

Hi,

In my ASPNet 2.0 C# web form, there's a
<asp:HyperLink ID="HyperLinkA" ...
NavigateUrl="http://MyIP/MyFolder/MySubFolder"> TestLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2 strings
"MyIPString"+"MyFolderString"?
Thanks for help.


Jason
 
M

Mark Rae [MVP]

In my ASPNet 2.0 C# web form, there's a
<asp:HyperLink ID="HyperLinkA" ...
NavigateUrl="http://MyIP/MyFolder/MySubFolder"> TestLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2
strings
"MyIPString"+"MyFolderString"?
Thanks for help.

Assuming that MyIPString and MyFolderString are server-side variables...

NavigateUrl="<%=MyIPString+MyFolderString%>"
 
J

Jason Huang

Seems not working yet ...
I'll try it later

Mark Rae said:
Assuming that MyIPString and MyFolderString are server-side variables...

NavigateUrl="<%=MyIPString+MyFolderString%>"
 
C

ca8msm

Hi,

In my ASPNet 2.0 C# web form, there's a
<asp:HyperLink ID="HyperLinkA" ...
NavigateUrl="http://MyIP/MyFolder/MySubFolder"> TestLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2 strings
"MyIPString"+"MyFolderString"?
Thanks for help.

Jason

The method I prefer is to do this in you SQL Statement e.g.

select MyIPString + ' ' + MyFolderString as myField from myTable

Mark,
http://aspnetlibrary.com
 
M

Mark Rae [MVP]

What I want is something like http://192.168.0.1/Root/Tree/FileName,
where the MyIPString represent the http://192.168.0.1/Root/Tree/,
and the MyFolderString represent the FileName.
OK.

Actually I don't think the MyIPString is an server-side variable, I want
to declare it in the ASPX file, but I don't know how.

protected MyIPString = "http://192.168.0.1/Root/Tree/";
And the value of FileName variable comes from a Label lblFileName.
Thanks for help.

NavigateUrl="<%=MyIPString+lblFileName.Text%>"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top