div control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    #1

    div control

    I have user control Functions with this function:

    Function createUrl(ByVal link As String, ByVal name As String, Optional
    ByVal stev As Int16 = 0, Optional ByVal cl As Int16 = 0) As String
    Dim clas As String
    If stev = 0 Then
    clas = ""
    End If
    If cl = 0 Then
    createUrl = "<table border=1><tr><t d><a href='" & link & "'>" &
    name & "</a></td></tr></table>"
    End If
    End Function
    Then I have page default.aspx where I register this control.

    If this was asp I can do like this:
    <%=createUrl("t est.aspx",test) %>
    <%=createUrl("t est1.aspx",test 1)%>

    How can I do the same with asp.net?

    I create 2 labels on page and on codebehind page I can use the control like
    this:
    Public functions As functions = New functions

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load
    'Here I can use this control like this:
    label1.text= functions.creat eUrl("test.asp" , "test")
    label2.text= functions.creat eUrl("test.asp" , "test")
    End Sub

    But If I do like this, label.text doesn't know the <table border='1'>
    Is there some kind of server control like <asp:span> or <asp:div> where you
    can add table and similar objects on codebehind page?

    Thank you,

    Simon


Working...