How to Concatanate the asp.net code with HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vikram Raman
    New Member
    • Feb 2010
    • 24

    How to Concatanate the asp.net code with HTML

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s) Handles Me.Load
    sPath = System.Web.Http Context.Current .Request.Url.Ab soluteUri
    // 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...
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Use an <asp:Hyperlin k> instead of a <a> tag.

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

    Comment

    • Vikram Raman
      New Member
      • Feb 2010
      • 24

      #3
      Thank you buddy....It works

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Glad I could help.

        Comment

        Working...