HighDots Forums  

asp.net ahref tag

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss asp.net ahref tag in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-D-
 
Posts: n/a

Default asp.net ahref tag - 11-02-2004 , 05:05 PM






What is the web control used in asp.net for a link?

A form web control in an ASP.Net page uses the following:

<asp:textbox ID="username" MaxLength="50" runat="server"
TextMode="SingleLine" class="tbyellow" />

I can then add the code behind logic in my class file to do what I need for
the form web control object.

For a link, the tag is:

<a href="somefile.aspx">Click Here</a>

What is the control for this tag in ASP.Net, so I can use code behind logic?
Is it the same? Or, do I just add:
<asp:a href="somefile.aspx">Click Here</a>

I'm not sure how I handle links in an ASP.Net file?

Thanks,
-D-



Reply With Quote
  #2  
Old   
darrel
 
Posts: n/a

Default Re: asp.net ahref tag - 11-02-2004 , 05:27 PM






Quote:
I'm not sure how I handle links in an ASP.Net file?
The easiest is probably to just put an asp:label on the page and add the
link as a string to that.

-Darrel




Reply With Quote
  #3  
Old   
Jon Spivey
 
Posts: n/a

Default Re: asp.net ahref tag - 11-02-2004 , 05:41 PM



Hi,
it would be
<asp:Hyperlink id="Something" runat="server"></asp:hyperlink>

Then in your code behind you can set the properties you need, NavigateUrl
(the page you want to go to), Text (the text to display) etc

Jon

"-D-" <noone (AT) nospam (DOT) com> wrote

Quote:
What is the web control used in asp.net for a link?

A form web control in an ASP.Net page uses the following:

asp:textbox ID="username" MaxLength="50" runat="server"
TextMode="SingleLine" class="tbyellow" /

I can then add the code behind logic in my class file to do what I need
for
the form web control object.

For a link, the tag is:

a href="somefile.aspx">Click Here</a

What is the control for this tag in ASP.Net, so I can use code behind
logic?
Is it the same? Or, do I just add:
asp:a href="somefile.aspx">Click Here</a

I'm not sure how I handle links in an ASP.Net file?

Thanks,
-D-





Reply With Quote
  #4  
Old   
-D-
 
Posts: n/a

Default Re: asp.net ahref tag - 11-02-2004 , 05:55 PM



Thnaks for the information. I appreciate the help.

Would it be better or is it more common to not use the text for the link in
the page...i.e.

<asp:Hyperlink id="Something" runat="server">Click Here</asp:hyperlink>

But rather, set the text for the link in the code behind...i.e. Text (the
text to display)

Thanks again for your help!
-D-

"Jon Spivey" <jons (AT) mvps (DOT) org> wrote

Quote:
Hi,
it would be
asp:Hyperlink id="Something" runat="server"></asp:hyperlink

Then in your code behind you can set the properties you need, NavigateUrl
(the page you want to go to), Text (the text to display) etc

Jon

"-D-" <noone (AT) nospam (DOT) com> wrote in message
news:cm91e6$pni$1 (AT) forums (DOT) macromedia.com...
What is the web control used in asp.net for a link?

A form web control in an ASP.Net page uses the following:

asp:textbox ID="username" MaxLength="50" runat="server"
TextMode="SingleLine" class="tbyellow" /

I can then add the code behind logic in my class file to do what I need
for
the form web control object.

For a link, the tag is:

a href="somefile.aspx">Click Here</a

What is the control for this tag in ASP.Net, so I can use code behind
logic?
Is it the same? Or, do I just add:
asp:a href="somefile.aspx">Click Here</a

I'm not sure how I handle links in an ASP.Net file?

Thanks,
-D-







Reply With Quote
  #5  
Old   
darrel
 
Posts: n/a

Default Re: asp.net ahref tag - 11-02-2004 , 06:20 PM



Quote:
Would it be better or is it more common to not use the text for the link
in
the page...i.e.

asp:Hyperlink id="Something" runat="server">Click Here</asp:hyperlink

But rather, set the text for the link in the code behind...i.e. Text (the
text to display)
If you need to manipulate the text on the fly, then stick it in the
codebehind. If not, just stick it on the aspx page as a plain-old anchor
tag.

-Darrel




Reply With Quote
  #6  
Old   
Jon Spivey
 
Posts: n/a

Default Re: asp.net ahref tag - 11-02-2004 , 06:46 PM



In most cases you'd want to generate the link text dynamically - in which
case you'd set it in code behind. If you want static text
<asp:Hyperlink id="Something" runat="server">Click Here</asp:hyperlink>
would be perfectly OK

Jon

"-D-" <noone (AT) nospam (DOT) com> wrote

Quote:
Thnaks for the information. I appreciate the help.

Would it be better or is it more common to not use the text for the link
in
the page...i.e.

asp:Hyperlink id="Something" runat="server">Click Here</asp:hyperlink

But rather, set the text for the link in the code behind...i.e. Text (the
text to display)

Thanks again for your help!
-D-

"Jon Spivey" <jons (AT) mvps (DOT) org> wrote in message
news:cm92fj$qm5$1 (AT) forums (DOT) macromedia.com...
Hi,
it would be
asp:Hyperlink id="Something" runat="server"></asp:hyperlink

Then in your code behind you can set the properties you need, NavigateUrl
(the page you want to go to), Text (the text to display) etc

Jon

"-D-" <noone (AT) nospam (DOT) com> wrote in message
news:cm91e6$pni$1 (AT) forums (DOT) macromedia.com...
What is the web control used in asp.net for a link?

A form web control in an ASP.Net page uses the following:

asp:textbox ID="username" MaxLength="50" runat="server"
TextMode="SingleLine" class="tbyellow" /

I can then add the code behind logic in my class file to do what I need
for
the form web control object.

For a link, the tag is:

a href="somefile.aspx">Click Here</a

What is the control for this tag in ASP.Net, so I can use code behind
logic?
Is it the same? Or, do I just add:
asp:a href="somefile.aspx">Click Here</a

I'm not sure how I handle links in an ASP.Net file?

Thanks,
-D-









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.