asp.net basic problem?

James H

New member
Hi, I have a website that I need to add some dynamic data from asp.net, I'm completely new to .net and am having some problems (usually a php user).

K so, I have
a simple html tag
<a href="" title = "" >my link</a>

Now all I want to do is to insert some data in to the href and title parameters. in php I would just use <a href="<?php echo myHrefvar?>" title = "<?php echo myTitlevar?>" >my link</a>

I've tried doing
<a href="<% = myHrefvar%>" title = "<% = myTitlevar%>" >my link</a>

and in my default.aspx.cs I have the variables being set
string myHrefvar = "my href";
string myTitlevar = "my title";

but it always gives the message that they're not linked.

Have also tried
<a href="" title = "" ID=Req1>my link</a>

and in the apsx.cs file
Req1.HRef = "sdsdsd";
Req1.Title = "sdsdsd";

but again I get an error saying Req1 doesn't exist in the current context.

So help, I'm missing something rather fundamental here, any help would be much appreciated.

James
Yes, I'm aware that php is more akin to asp and that asp.net is completely different. It's not about picking one, I'm moved jobs and they use asp.net rather than php which is fine I just need to learn it, but right now I have a particular need and problem which is why I posted the question. What I don't need is somebody telling me that I need to pick one, unless you're just trying to excel at being irritating and self-righteous!
 
Back
Top