0
<asp:Label ID="Label4" runat="server" Text="+905554443322" Font-Size="Small"></asp:Label>

<a class="float" href="https://api.whatsapp.com/send?phone=" + "Label4.Text" target="_blank"> <i class="fa fa-whatsapp my-float"></i>

Dear members of the forum. In my ASP.Net work, I want to bring the text value of label4 to the place inside the link. I just couldn't make it.

So I want to bring the text value of Label4 to the relevant place in the web.whatsapp link. Any help will be appreciated. Thank you.

1 Answer 1

1

not quite clear, but since the lable is a server side control, then make the hyper link also server side.

Eg this:

        <asp:Label ID="Label4" runat="server" Text="+905554443322" 
            Font-Size="Small"></asp:Label>

       <a class="float" id="MyRef" runat="server" href="" target="_blank"> 
           <i class="fa fa-whatsapp my-float"></i>
        </a>

So, on page load, then set the href value:

Private Sub form1_Load(sender As Object, e As EventArgs) Handles form1.Load

    MyRef.HRef = "https://api.whatsapp.com/send?phone=" + Label4.Text

End Sub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.