這是我已經實現,爲進一步的代碼,如何發送文本框的文本到服務器存儲在變量或數據庫中沒有回發?如何使用JavaScript發送短信以避免回傳?
它可以通過使用Ajax和更新平面來完成,但我想使用JavaScript腳本來實現它。
<div id="CommentID" style=" width:30%; height:30%">
<asp:Button ID="Button1" runat="server"
Text="Comment"
OnClientClick="visibleDiv('id1'); return false;" />
<div id="id1" runat="server" style="visibility: hidden; background-color:Green; width:100%; height:100%">
<asp:TextBox ID="TextBox1" runat="server"
AutoCompleteType="Disabled" Rows="3"
TextMode="MultiLine" Width="98%">
</asp:TextBox>
<asp:Button ID="Button2" runat="server"
Text="Post"
onclick="Button2_Click" />
<asp:Button ID="Button3" runat="server"
Text="Cancel"
OnClientClick="visibleDiv('id1'); return false;" />
</div>
</div>
thnks did you urt code says 012rbut錯誤請檢查它,因爲我不知道它是什麼意思? – user287745 2010-05-25 19:45:39
public partial class _Default:System.Web.UI 。頁 { [System.Web.Services。的WebMethod] 公共靜態字符串SendString(文本串) { //存儲字符串在數據庫 } 保護無效的Page_Load(對象發件人,EventArgs的) { } – user287745 2010-05-25 19:47:22