Public Class MyWebForm
Inherits System.Web.UI.Page
Public a As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
a = "test"
End Sub
End Class
if i put the response.write(temp) just in normal html then its okay but if i put it in with the url link thing it doesnt work.
is this not a very good way of doing it? What i was gonna do was read some values from a database in the code behind and fill a dataset. Then in the html code loop through the dataset, filling url objects with urls and descriptions.
I know u can use a datagrid but i was trying to stay away from that.
Response.Write() should be working, but if for some reason its not you could alternatively try;
<%=temp%>
**EDIT**
Okay I know why.. you have to bind the variable. To do that use;
<%# temp %>
And then in your page load you need to make sure the control gets bound by doing this;
yourHyperLinkID.DataBind()
or if you want to make sure all controls on your page are bound (if you have several that bind data), instead of binding one at a time, you can just do this;
Me.DataBind()
Heres a sample I wrote up in C# real quick (can easily be converted to VB)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.