閲覧総計:5506 (本日:1 昨日:0)
ファイルの削除等「確認画面」を表示し、再確認して処理を行う方が良い場合が多々
ある。ASP.NETで「確認画面(Confirm)」を表示する法を確認したのでメモしておく。
10/09/12
【参考にしたページ】
「ASP.NETでボタンのクリック時に確認メッセージを表示するには?」03/4/18
http://www.atmarkit.co.jp/fdotnet/dotnettips/015confirm/confirm.html
意味:Confirm 確認する
開発環境:VWD2008 + Access2003
サーバ:ASP.NET3.5 + Access2003
【目次】↓タイトルをクリックするとそこへ飛べます。
【実行画面】
【ConfirButton.aspx】
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 'ページを初期化するユーザー コードをここに挿入します。 Button1.Attributes("onclick") = "return confirm('本当に移動しますか?');" End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Redirect("http://www.atmarkit.co.jp/fdotnet/") End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> ASP.NETで「確認画面」を表示する法 10/09/12<br /> <br /> 【機能】ボタンをクリックすると「確認画面」を表示し、次の処理に進む。<br /> 【参考ページ】<br /> 「<a href="http://www.atmarkit.co.jp/fdotnet/dotnettips/015confirm/confirm.html">ASP.NETでボタンのクリック時に確認メッセージを表示するには?</a>」03/4/18<br /> <br /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Insider.NETのページへ" /> <br /> <br /> </div> </form> </body> </html>
【参考にしたページ】
「ASP.NETでボタンのクリック時に確認メッセージを表示するには?」03/4/18
http://www.atmarkit.co.jp/fdotnet/dotnettips/015confirm/confirm.html
【実装のポイント】
カレンダ日付の<a >タグに confirm のスクリプトを登録する手法で目的動作を実現する。
【実行画面】
【ConfirmCalendar.aspx】
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) If e.Day.IsToday Then e.Cell.Controls.Clear() e.Cell.Controls.Add(RemodelDayLink(e)) End If End Sub Protected Function RemodelDayLink(ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) As HtmlAnchor Dim DayLink As New HtmlAnchor() DayLink.HRef = e.SelectUrl DayLink.InnerText = e.Day.DayNumberText DayLink.Title = e.Day.Date.ToString("m", Globalization.CultureInfo.CurrentCulture) DayLink.Attributes("onclick") = "return confirm('本当に移動しますか?');" Return DayLink End Function Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) If Calendar1.SelectedDate.ToString("yyyy/MM/dd") = Now().ToString("yyyy/MM/dd") Then Response.Redirect("http://www.atmarkit.co.jp/fdotnet/") Else TextBox1.Text = Calendar1.SelectedDate.ToString("yyyy/MM/dd") End If End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> カレンダの日付クリックで「確認画面」を表示する法 10/09/12<br /> <br /> 【機能】カレンダの今日の日付をクリックすると「確認画面」を表示し、<br /> 次の処理(Insider.NETのページ表示)に進む。<br /> 【参考ページ】<br /> 「<a href="http://www.atmarkit.co.jp/fdotnet/dotnettips/015confirm/confirm.html">ASP.NETでボタンのクリック時に確認メッセージを表示するには?</a>」03/4/18<br /> <br /> 日付<asp:TextBox ID="TextBox1" runat="server" Width="117px"></asp:TextBox> <br /> <asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged" OnDayRender="Calendar1_DayRender"></asp:Calendar> <br /> </div> </form> </body> </html>
【参考にしたページ】
「ASP.NETでボタンのクリック時に確認メッセージを表示するには?」03/4/18
http://www.atmarkit.co.jp/fdotnet/dotnettips/015confirm/confirm.html
http://www.tiffany-jewelry.net/ will http://www.nike-air-max.com.de/ rely http://www.adidas-superstar.nl/ on http://www.tommy-hilfiger.com.de/ the http://www.basketballshoes.com.co/ holding http://www.pradahandbags.net.co/ to http://www.hermes-outlet.com.co/ go, http://www.thenorth-faces.co.uk/ if http://www.newbalance-outlet.org/ there http://www.louisvuitton-outlet.com.co/ is http://www.ugg-australia.com.de/ any http://www.newbalance-shoes.org/ sign http://www.cheap-raybans.com/ of trouble, but also http://www.burberry-handbagsoutlet.com.co/ possession http://www.cheaprayban.com.co/ of http://www.adidas.org.es/ arms http://www.coachblackfriday.com/ aunt. http://www.hollisterclothingstore.org/ Her http://www.barbour-jacketsoutlet.com/ body http://www.timberlandshoes.net.co/ will http://www.pulseras-pandora.com.es/ always http://www.tommyhilfiger.net.co/ be a http://www.nike-schuhe.com.de/ good http://www.cheapjerseys.com.co/ smell, http://www.guccioutlet-sale.in.net/ grassy http://www.ralphlaurenepolo.com/ taste http://www.p90xworkout.us.com/ of http://www.eyeglassesonline.us.com/ green http://www.the-north-face.ca/ time, http://www.uggs-onsale.net/ even http://www.airjordans.us/ more http://www.mcmsworldwide.com/ than his http://www.uggboots.com.de/ grandmother sandalwood incense http://www.salvatoreferragamo.in.net/ out many http://www.tiffany-andco.com.au/ times. http://www.soft-ballbats.com/ (Read the http://www.replica-handbags.in.net/ article http://www.nike-shoes-canada.ca/ Network: www.sanwen.net)So, I http://www.handbagsoutlet.net.co/ like http://www.christianlouboutinoutlet.net.co/ aunt, http://www.nfl-jersey.us.com/ preferring to http://www.michael-kors-outlet.us.org/ let http://www.nikeskos.dk/ her http://www.chanel-bags.com.co/ hold. http://www.abercrombie-fitchsale.com/ Aunt http://supra.shoesoutlet.us.com/ grandmother http://www.thenorthfacejackets.net.co/ is http://www.cheapjerseys.us.org/ to http://www.yoga-pants.ca/ allow http://www.bottegaveneta-bagsoutlet.com/ a http://www.michael-kors-outlet-online.us.org/ lot http://www.the-northfacejackets.us.com/ of care http://www.mk-outlet.us.com/ of http://www.pandora-charms.org.uk/ me and http://www.burberry2016.co.uk/ coax me http://www.nike-shoesoutlet.us.com/ play.Most http://www.ray-ban-outlet.us.com/ of http://www.asics-outlet.us.com/ the http://www.ralphlaurenoutletonline.in.net/ time http://www.nikefree-run.net/ we http://www.nike-air-max.ca/ were http://www.polooutlets-store.com/ running http://www.supra-shoes.org/ out Feng Wan, http://www.tommy-hilfiger-online-shop.de/ climb http://www.airmax-90.org/ the http://www.oakley-sunglasses.mex.com/ hill http://www.vans-schuhe.com.de/ pick berries, http://www.rosherun.org.uk/ go http://www.longchamp.us.org/ to http://www.hollister-abercrombie.com.se/ the http://www.swarovski-online-shop.de/ stream http://www.the-northface.net.co/ edge http://www.abercrombie-hollister.nl/ scoop tadpoles and grass http://www.longchamp-handbags.us.com/ carp. http://coach.euro-us.net/ I especially http://www.ralphlaurenoutlet.us.com/ like http://www.michael-kors-handbags.us.com/ to http://www.asicsgels.de/ play, http://www.toms-outlets.us.com/ but http://www.outlet-burberry.net.co/ also are http://www.mcmhandbags.com.co/ a http://www.tomsshoes-outlet.us.com/ go http://www.toms--outlet.com.co/ pestering http://www.ugg-boots.us.org/ aunt, http://www.tommy-hilfigeroutlet.com/ in http://www.mcm-bags.in.net/ childhood, http://www.rolex-watch.me.uk/ she used http://www.hollister-clothing.in.net/ to http://www.michaeljordan.com.de/ be http://www.truereligion-outlet.com.co/ my http://www.michael-kors.com.co/ best http://www.michael-kors-taschen.com.de/ friend, http://www.ugg-boots.ca/ even http://www.adidasshoes.top/ though http://www.nike-air-max.us/ she http://www.thejoreseproject.com/ was http://www.louisvuitton.so/ more http://www.jordanrelease-dates.us.com/ than http://www.ferragamo.com.co/ I http://www.oakley-sunglasses-canada.ca/ was http://www.longchamphandbagsoutlet.net/ up http://www.beats-by-dre.com.co/ a http://www.coach-purseoutlet.net/ big http://www.pandorajewelry.top/ slice. http://www.swarovski-australia.com.au/ She http://www.coach-factory.in.net/ often http://www.levisjeans.com.co/ cajole, http://www.cheapoakley-sunglasses.com/ and http://nike.shoesoutlet.us.com/ looked at http://www.hollisters-canada.ca/ me http://www.bcbg-max-azria.ca/ to http://www.ralph-laurenoutlet.ca/ sleep, http://www.rayban-sunglassesoutlet.co.uk/ I http://www.coachoutletstore-online.com.co/ do http://www.coco-chanel.com.de/ not http://www.nikestore.com.de/ want http://www.ugg-uggboots.net/ a http://www.canada-goosesjackets.us.com/ person to sleep, http://www.burberry-outletonlinesale.in.net/ especially http://www.cheap-baseballbats.net/ in http://www.pandora.com.de/ the http://www.uggsoutlet.com.co/ cabin http://www.jimmy-choos.com/ my http://www.raybans.us.org/ own http://airhuarache.shoesoutlet.us.com/ house, http://www.moncler-outlet.us.org/ I http://www.ferragamoshoes.in.net/ will http://www.nike-roshe-run.de/ pull http://www.burberryonlineshop.de/ aunt http://www.oakley-sunglassoutlet.net/ sleeves, http://www.tommy-hilfiger.co.nl/ let http://www.rolexwatchesforsale.us.com/ her http://www.nike-skor.com.se/ tell http://www.chiflatiron.net.co/ me stories http://www.airhuarache.co.uk/ before http://www.abercrombie-fitchs.us.com/ they http://www.hollister.us.org/ agree http://www.tomsoutletonline.net/ to http://www.abercrombie-kids.us.com/ sleep. http://www.pumaonline-shop.de/ Sometimes http://www.adidas-schuhe-online.de/ aunt http://www.hermesbags.jp.net/ tired, http://www.rayban.org.es/ rest will be http://www.weddingdressesuk.org.uk/ lying next http://www.michael-kors-australia.com.au/ to http://www.burberrysoutlet2016.com/ me, http://www.tommy-hilfiger-canada.ca/ but http://www.hollisteronlineshop.com.de/ my http://www.nikestore.us/ time is the http://www.christian--louboutin.in.net/ most mischievous of http://www.converse-shoes.net/ the opportunity, I http://www.polo-ralph-lauren.de/ would http://www.celine-bags.org/ deliberately http://www.ralphslauren-outlet.co.uk/ squeezed http://www.kate-spade.gb.net/ her, http://airmax.shoesoutlet.us.com/ or get http://www.michaelkorsoutletonline-sale.us.com/ up http://www.lululemon-australia.com.au/ reading http://www.tnf-jackets.us.com/ her http://www.louboutin.jp.net/ lashes http://monsterbeats.co-om.com/ beating, but http://www.longchamp-handbagsoutlet.us.com/ also http://northfaceoutlet.co-om.com/ scratching http://www.bottega-veneta.us.com/ her http://www.thenorthface.com.de/ itch, http://www.converse.net.co/ she http://www.michaelkors.co.nl/ will http://www.nike-schoenen.co.nl/ pretend http://www.abercrombieand-fitch.ca/ angry, http://www.swarovskijewelry.com.co/ but http://www.new-balance-schuhe.de/ also http://www.oakleys-sunglasses.us.com/ drum http://www.jimmy-chooshoes.com/ up http://www.swarovski-crystal.us.com/ toot http://www.insanity-workout.us.com/ mouth http://www.barbour-factory.com/ scare http://www.prada-shoes.com.co/ me. http://www.the-northface.com.co/ -- [[ZYF]] &new{2016-03-23 (水) 11:42:03};