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 回答