0

私はこのcssコードを持っています:

form 
{
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#6EA5FF);
background: -webkit-gradient(linear, bottom, left 175px, from(#CCCCCC), to(#EEEEEE));
background: -moz-linear-gradient(bottom, #CCCCCC, #EEEEEE 175px);
background-color: #E0E0E0;
margin:auto;
position:relative;
width:640px;
height:820px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
font-style: normal;
line-height: 24px;
font-weight: bold;
color: black;
text-decoration: none;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding:10px;
border: 1px solid #999;
border: inset 1px solid #333;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
} 

このフォームの場合:

<form  id="form" runat="server">
    <h1 align="center">Ticker Tape Updater</h1>
        <legend>Message (to be appended to current message)</legend>

フォーム内の asp ボタンをクリックして電子メールを送信すると、フォームは画面の左側に移動します。これは元々中央にありました。電子メールを送信した後、vbscript に警告ボックスを呼び出して、電子メールが送信されたことを示すコードがいくつかあります。ページを更新すると、電子メールのポップアップ ボックスが表示され、電子メールが再度送信されますが、フォームはまだページの左側にあります。すべてのテキスト ボックスをクリアし、すべてのチェックボックスをリセットするページ上の ASP ボタンをクリックすると、フォームが中央に戻ります。ページを更新して警告メッセージが再度表示され、電子メールが再度送信されたとき、コードの実行が完了していないか何かだと思います。何か案は?ここに私のvbコードがあります:

Protected Sub submitBtn_Click(sender As Object, e As System.EventArgs) Handles submitBtn.Click

    Dim msg As String = "- " + TextBox1.Text + " -"

    If (Checkbox4.Checked = True Or Checkbox5.Checked = True) And (DepartmentIsSelected() = False) Then
        Exit Sub
    Else

        If AtLeastOneIsChecked() = True Then

            'Add message to Screen 1
            If Checkbox1.Checked Then
                UpdateMessage(1, msg)
            End If

            'Add message to Screen 2
            If Checkbox2.Checked Then
                UpdateMessage(2, msg)
            End If

            'Add message to Screen 3
            If Checkbox3.Checked Then
                UpdateMessage(3, msg)
            End If


        End If


        If (Checkbox4.Checked = True Or Checkbox5.Checked = True) And (DepartmentIsSelected() = True) Then

            'Send emails
            If Checkbox4.Checked And DepartmentIsSelected() Then
                SendMessageToEmailOrText("email", msg)
            End If

            'Send texts
            If Checkbox5.Checked And DepartmentIsSelected() Then
                SendMessageToEmailOrText("text", msg)
            End If

        End If

        If AtLeastOneIsChecked() Then
            ClearAll()
        End If
    End If

End Sub

Protected Sub UpdateMessage(ByVal screenNumber As Integer, ByVal message As String)

"code for sub"

End Sub
    Protected Sub SendMessageToEmailOrText(ByVal emailOrText As String, ByVal message As String)
        'This section grabes the email addresses and text address from the function then send out the emial and text seperately not in the same message.

    'grabEmailAddresses()
    'grabTextAddresses()
    Dim subject As String = "Broadcast Alert"
    Dim mClient = New SmtpClient("smtp.aaicorp.com")
    Dim addresses As String
    Dim addresses1 As String

    If emailOrText = "email" Then
        '*******************************************************************************************************************
        'This section addes Bcc to the To: line so there is no one listed in this line and the people do not see all the emil addresses

        'create the mail message
        Dim mail As New MailMessage()

        'set the addresses
        'to specify a friendly 'from' name, we use a different ctor
        mail.From = New MailAddress("flims@aai.textron.com", "FLIMS Site")

        'since the To,Cc, and Bcc accept addresses, we can use the same technique as the From address
        'since the To, Cc, and Bcc properties are collections, to add multiple addreses, we simply call .Add(...) multple times
        'addresses = "spowers@aai.textron.com"
        addresses &= grabEmailAddresses() ' addresses is dimensioned before the if statement The grabEmailAddressed is a function to get the email addresses
        Dim SendBcc As String = (addresses)
        mail.Bcc.Add(SendBcc)

        'Response.Write("<script>alert('" & addresses & "')</script>")
        'Response.Write("<script>alert('" & SendBcc & "')</script>")

        'set the content
        mail.Subject = "Broadcast Alert"

        'set the body 
        mail.Body = message

        'Send the email 
        'mClient.Send(mail) 'mClient is dimensioned before the if statement
        Response.Write("<script>alert('Email Messages Sent')</script>")

        System.Threading.Thread.Sleep(4000) ' This is used to have a pause to send out the first message if you send email and text


        '*****************************************************************************************************************************
        'If you want to see all of the sender do this instead uncomment this section and commnet out the above

        ''Response.Write("<script>alert('" & addresses & "')</script>")
        'Dim m = New MailMessage("flims@aai.textron.com", addresses, subject, message)
        'mClient.Send(m)
        'System.Threading.Thread.Sleep(4000) ' This is used to have a pause to send out the first message if you send email and text
    Else
        addresses1 &= grabTextAddresses() ' addresses is dimensioned before the if statement The grabTextAddressed is a function to get the text phone numbers
        'Response.Write("<script>alert('" & addresses1 & "')</script>")
        'Response.Write("<script>alert('" & message & "')</script>")
        Dim m = New MailMessage("flims@aai.textron.com", addresses1, subject, message)
        'mClient.Send(m) ' mClient is dimensioned befor the if statement and "m" is dimension above
        Response.Write("<script>alert('Text Messages Sent')</script>")
    End If

End Sub

Protected Function grabEmailAddresses() As String

    "code for function"
End Function


Protected Function grabTextAddresses() As String
    "code for function"
End Function

必要に応じて、関連するすべてのコードをここに入れておきます。ボタンのクリックが最初で、その後のすべての機能が実行されます。現在、メール/テキスト送信 (mClient.Send()) はテストのためにコメントアウトされています。私の問題に関するご意見をお待ちしております。ありがとうございます。

4

1 に答える 1

0

これがフォームを左に押す理由はまだわかりませんが、位置を絶対位置に変更して中央に配置position:absolute;left:25%;ました。だから、私が探していたものではなく、修正です。

于 2013-01-28T20:18:50.663 に答える