473,811 Members | 3,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASPNet HyperLink NavigateUrl question

Hi,

In my ASPNet 2.0 C# web form, there's a
<asp:HyperLin k ID="HyperLinkA " ...
NavigateUrl="ht tp://MyIP/MyFolder/MySubFolder"Tes tLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2 strings
"MyIPString"+"M yFolderString"?
Thanks for help.
Jason
Aug 17 '07 #1
6 6483
"Jason Huang" <Ja************ @hotmail.comwro te in message
news:er******** ******@TK2MSFTN GP04.phx.gbl...
In my ASPNet 2.0 C# web form, there's a
<asp:HyperLin k ID="HyperLinkA " ...
NavigateUrl="ht tp://MyIP/MyFolder/MySubFolder"Tes tLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2
strings
"MyIPString"+"M yFolderString"?
Thanks for help.
Assuming that MyIPString and MyFolderString are server-side variables...

NavigateUrl="<% =MyIPString+MyF olderString%>"
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 17 '07 #2
Seems not working yet ...
I'll try it later

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.net>
???????:%2***** **********@TK2M SFTNGP06.phx.gb l...
"Jason Huang" <Ja************ @hotmail.comwro te in message
news:er******** ******@TK2MSFTN GP04.phx.gbl...
>In my ASPNet 2.0 C# web form, there's a
<asp:HyperLi nk ID="HyperLinkA " ...
NavigateUrl="h ttp://MyIP/MyFolder/MySubFolder"Tes tLink </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+MyF olderString%>"
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 17 '07 #3
On 17 Aug, 09:08, "Jason Huang" <JasonHuang8... @hotmail.comwro te:
Hi,

In my ASPNet 2.0 C# web form, there's a
<asp:HyperLin k ID="HyperLinkA " ...
NavigateUrl="ht tp://MyIP/MyFolder/MySubFolder"Tes tLink </asp:HyperLink>
My question is how to config the NavigateUrl as the combination of 2 strings
"MyIPString"+"M yFolderString"?
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

Aug 17 '07 #4
"Jason Huang" <Ja************ @hotmail.comwro te in message
news:OB******** ******@TK2MSFTN GP02.phx.gbl...

Top posting corrected...
>Assuming that MyIPString and MyFolderString are server-side variables...

NavigateUrl="< %=MyIPString+My FolderString%>"
Seems not working yet ...
I'll try it later
What are MyIPString and MyFolderString? Where do they come from?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 17 '07 #5
Thanks.
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.
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.
And the value of FileName variable comes from a Label lblFileName.
Thanks for help.
Jason


"Mark Rae [MVP]" <ma**@markNOSPA Mrae.net>
???????:eS***** *********@TK2MS FTNGP05.phx.gbl ...
"Jason Huang" <Ja************ @hotmail.comwro te in message
news:OB******** ******@TK2MSFTN GP02.phx.gbl...

Top posting corrected...
>>Assuming that MyIPString and MyFolderString are server-side variables...

NavigateUrl=" <%=MyIPString+M yFolderString%> "
>Seems not working yet ...
I'll try it later

What are MyIPString and MyFolderString? Where do they come from?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 20 '07 #6
"Jason Huang" <Ja************ @hotmail.comwro te in message
news:uo******** ******@TK2MSFTN GP02.phx.gbl...
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+lbl FileName.Text%> "
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 20 '07 #7

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

Similar topics

5
3970
by: Mark Fox | last post by:
Hello, When I set a hyperlink server control's NavigateUrl to Webform.aspx?a=0&b=0 it outputs Webform.aspx?a=0&amp;b=0
0
959
by: Cynic07 | last post by:
As you can guess it in my subject, my question is for Microsoft System.Web.UI.WebControls team: Why HyperLink.NavigateUrl property is not marked as virtual? (I cannot override this property in a derived HyperLink control). Thanks!
2
1500
by: MrMike | last post by:
I am attempting to pass a parameter named "BackURL" into a asp:Hyperlink HTML control as shown below. "BackURL" is actually a variable defined in the page's code-behind. However, my current formatting below causes a "Page cannot be displayed" error, and is invalid. How can I properly reference my BackURL variable in the NavigateURL property of the asp:Hyperlink control? Thanks. <asp:HyperLink runat="server" Text="Update"...
0
1291
by: Nathan Sokalski | last post by:
Whenever I assign a value to the HyperLink.NavigateUrl property, it adds an extra ../ in the generated href= attribute of the anchor tag. For example, when I assign it the value "comments.aspx" the href attribute comes out as href="../comments.aspx" The location of the file with the code that generates the anchor is in the root directory, while the aspx file is one level deeper. Could this be the problem? If it is, how can I fix it so that...
1
1209
by: tshad | last post by:
I need to explicitly use the path of my page and am trying to do the following: <asp:Hyperlink ID="test" Text="HyperLinkTest" NavigateUrl=<%# request.ServerVariables("PATH_INFO").Substring(0,request.ServerVariables("PATH_INFO").LastIndexOf("/")+1) & "displayCompanyOverview.aspx" %runat="server"/><br> This doesn't work as it only displays static text. In my trace statement,
1
1624
by: Jason Huang | last post by:
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.
1
1538
by: Jason Huang | last post by:
Hi, My ASPNet HyperLink NavigateUrl is like http://192.168.0.1/OtherFolder/§ÚªºÀɮק¨/myfile, the OtherFolder is another folder rather than the ASPNet application's default folder in the IIS. However, since there're some none English characters in the NavigateUrl, the characters after the OtherFolder/ becomes some "%e6%b8%ac%e8%a9%a6%e5%a0%b1%", and the Link is not functionning properly. Would someone give me some advice? Thanks for...
1
1229
by: Jason Huang | last post by:
Hi, In my ASPNet 2.0 C#.Net, I have a string manipulation for a HyperLink as string strHLink= "<a href=\"" + HyperLink1.NavigateUrl.ToString() + "\">" + HyperLink1.Text.ToString() + "</a>" But how do I set the StatusBar to a special string for that strHLink to represent the HyperLink in the .aspx.cs file? Thanks for help.
6
23524
by: Dmitry Duginov | last post by:
I have a FormView and a HyperLink on the page. If I use the following code behind (hooked up to Hyperlink's OnLoad event), it renders fine protected void link_Load(object sender, EventArgs e) { link.NavigateUrl = String.Format("~/Carrier/AddNew.aspx?Id={0}", FormView1.DataKey.Value); }
0
10647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10384
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...
1
10395
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10130
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
9204
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...
1
7667
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6887
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4338
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

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.