473,394 Members | 1,709 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.

How to Concatanate the asp.net code with HTML

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
sPath = System.Web.HttpContext.Current.Request.Url.Absolut eUri
// Response.Write(sPath)
End Sub


I want to concatanate the string stored in sPath with the following HTML Code:

<a href="http://del.icio.us/post?url=< % I want to concatenate here %> > </a>


I dont know how to do this.

It will be ver useful to me if u send any solution for this...
Feb 18 '10 #1

✓ answered by Curtis Rutland

Use an <asp:Hyperlink> instead of a <a> tag.

Your ASP.NET code would be like this:
Expand|Select|Wrap|Line Numbers
  1. <asp:Hyperlink ID="MyLink" runat="server" Text="Link Text" />
And your VB.NEt would be like this:
Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.   Dim linkPath as String
  3.   linkPath = "http://del.icio.us/post?url="
  4.   sPath = System.Web.HttpContext.Current.Request.Url.AbsoluteUri
  5.   linkPath = linkPath & sPath
  6.   MyLink.NavigateUrl = linkPath
  7. End Sub

3 1305
Curtis Rutland
3,256 Expert 2GB
Use an <asp:Hyperlink> instead of a <a> tag.

Your ASP.NET code would be like this:
Expand|Select|Wrap|Line Numbers
  1. <asp:Hyperlink ID="MyLink" runat="server" Text="Link Text" />
And your VB.NEt would be like this:
Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.   Dim linkPath as String
  3.   linkPath = "http://del.icio.us/post?url="
  4.   sPath = System.Web.HttpContext.Current.Request.Url.AbsoluteUri
  5.   linkPath = linkPath & sPath
  6.   MyLink.NavigateUrl = linkPath
  7. End Sub
Feb 18 '10 #2
Thank you buddy....It works
Feb 19 '10 #3
Curtis Rutland
3,256 Expert 2GB
Glad I could help.
Feb 19 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Desmond | last post by:
Can someone please tell me how to concatanate to strings like this please $name = $_POST; $from = $_POST; $headers = "From: $name $from\r\n"; i beleve in C there is a strcat() is this...
14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
25
by: sravishnu | last post by:
Hello, I have written a program to concatanae two strings, and should be returned to the main program. Iam enclosing the code, please give me ur critics. Thanks, main() { char s1,s2;...
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
3
by: Peted | last post by:
Is it possible to concatanate a string and a byte array, into a "string" variable, send it as a string to an ip socket device and have the bytes, seen as a sequence of bytes, not char or string ? ...
17
by: radhikams | last post by:
Hi I want to create a drag drop tool box using javascript... Can anyone please guide me in this regard Thanks
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: 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...
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
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.