Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Pedersen 5 posts 25 karma points
    Apr 17, 2010 @ 11:44
    Jesper Pedersen
    0

    Loads only the first line?

    Hello..

    I have created an ascx usercontrole, an loaded it in an macro. That works fine, and i can also load it in the editor for my page.

    And all looks fine.. but when i look at my page it only takes the first cuple of lines..

    My code for my ascx file looks like this:

     <%@ Control Language="VB" ClassName="ContactForm" %>
    <%@ Import Namespace="System.Net.Mail" %>
    <script runat="server">

        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim Name As String = tbName.Text
            Dim msg As String = tbMsg.Text
            Dim Email As String = tbEmail.Text

            Dim nMail As New MailMessage(New MailAddress(Email, Name), New MailAddress("[email protected]"))
            nMail.Body = msg
            nMail.IsBodyHtml = True

            Dim smtp As New SmtpClient
            smtp.Send(nMail)
        End Sub
    </script>

    <table align="center" class="style1">
        <tr>
            <td>
                Dit navn:<br />
                <asp:TextBox ID="tbName" runat="server" Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                Din e-mail:<br />
                <asp:TextBox ID="tbEmail" runat="server" Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                Din besked:<br />
                <asp:TextBox ID="tbMsg" runat="server" Height="98px" TextMode="MultiLine"
                    Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
                    Text="Send besked" />
            </td>
        </tr>
    </table>

     

    And the only thing i can see on my page is "Dit navn:" and if i look in the source the only thing showing is:

     <table align="center" class="style1">
        <tr>
            <td>
                Dit navn:<br />

    So it breaks when it reaches the textbox..

    Can anyone please tell me whats wrong??

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 18, 2010 @ 12:04
    Jan Skovgaard
    0

    Hi Jesper

    Are you placing the user control on a page via the "insert macro" option in the rich text editor?

    If so...does the same thing happen when you just place it directly on a template instead?

    /Jan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies