views:

37

answers:

3

hello i have a silly issue, my link isn't shown. i use the same code like in an other programm (despite i forget something)

 <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml"&gt;


<script  runat="server">


    Sub Page_Load()

        If IsPostBack Then
            meinnewLink.InnerHtml = "Beispiele und weitere Erklärungen"
            meinnewLink.HRef = "http://lucene.apache.org/java/2_9_1/queryparsersyntax.html"
            meinnewLink.Title = "Lucene"
            meinnewLink.Name = ("Arial")
            meinnewLink.Target = "_top"
        Else
            meinnewLink.InnerHtml = "Beispiele und weitere Erklärungen"
            meinnewLink.HRef = "http://lucene.apache.org/java/2_9_1/queryparsersyntax.html"
            meinnewLink.Title = "Lucene"
            meinnewLink.Name = ("Arial")
            meinnewLink.Target = "_top"

        End If

    End Sub

</script>


<head runat="server">
    <title>Hilfe</title>
</head>
<body>
    <form id="form1" runat="server">

    <asp:Image ID="Image1"
runat="server"
AlternateText="logo"
ImageUrl="logo.bmp"/>


    <p><u> Grundfunktionalitäten:</u></p> 
    Volltextsuche: Suche im Text<br />
    Dateinamensuche: Suche im Titel<br />
    Eine Kombination ist möglich<br /><br />

    OR: Oder Verknüpfung der Suchbegriffe (Defaulteinstellung)<br />
    AND: Und Verknüpfung der Suchbegriffe<br />
    NOT: schließt einen Suchbegriff aus<br />
    *: Wildcard für mehrere Buchstaben<br />
    ?: Wildcard für einen Buchstaben<br />
    Hinweis: Wildcard darf nicht der erste Buchstabe sein <br />

    <p><font size="2"><a runat="server" id="meinnewLink"  style ="font-family :Arial " ></a></font></p>


    </form>
</body>
</html>

well i searched the mistake but i can't find it :>

+1  A: 

I think the InnerHtml is wrong, it should be InnerText

edit

When I tried to recreate this I had the page load event overriden in the code behind file and the script code did not run, when I removed it from the code behind it ran. Can you check that you do not have the page load event in the code behind?

Pharabus
with innertext it doesn't work too
Tyzak
can you view source on the page and paste the relevant parsed html here so we can see?
Pharabus
A: 

Hey,

Right click the page on the client and view source... do you see text between the tags?

Brian
+1  A: 

missing meinnewLink.Text?

Try using a server-side control like LinkButton or HyperLink.

jinsungy
i added .innertext it still isn't shown
Tyzak
This. Unless you have some specific reason for using <a instead of <asp:HyperLink
Kevin