Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- 웹 서비스
- C#
- SpringSource Tool Suite
- 웹뷰
- 자바
- scrollView
- Redirect
- Apache Lucene
- html
- 이클립스
- TextBox
- varags
- javascript
- asp.net
- Eclipse
- 안드로이드
- WebView
- Bootstrap
- Android
- MSsql
- Maven
- MS-SQL
- jsp
- STS
- 자바스크립트
- Web Service
- 컬럼명
- Java
- decompiler
- MANTIS
Archives
- Today
- Total
bboks.net™
ASP.NET Code Behind에서 사용자 확인 후 액션 호출 본문
ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> html xmlns="http://www.w3.org/1999/xhtml" > head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> function ShowConfirmation() if(confirm("Are you want to show the value?")== true) //Calling the server side code after confirmation from the userdocument.getElementById("btnAlelrt").click(); </script> head> body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtDetails" runat="server"></asp:TextBox> <br /> <asp:Button ID="btnDetails" runat="server" Text="GetValue" OnClick="btnDetails_Click" /> <asp:Button ID="btnAlelrt" runat="server" Text="GetDetails" OnClick="btnAlelrt_Click" /> <br /> <br /> </div> </form> body> html>
Code Behind
using System;
using
System.Data;using
System.Configuration;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls;public
partial class _Default : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
//hide the button from users visibilitybtnAlelrt.Style.Add(
"display", "none");}
protected void btnDetails_Click(object sender, EventArgs e){
//Write your code which you wish to execute before the Confirmation from the USer
Page.ClientScript.RegisterStartupScript(
}
protected void btnAlelrt_Click(object sender, EventArgs e){
//write your code which you wish to execute after the confirmation from the user....
Page.ClientScript.RegisterStartupScript(
}
}
[출처] User confirmation from code behind