|  |  | 
          
            | อยากให้ textbox1 ได้รับค่า  id="result_scan"    รบกวนอาจารย์ช่วยเหลือด้วยครับ 
 
 
 
  
 
 Code (JavaScript)
 
 
<div style="text-align: center;">
        <div id="reader" style="width: 500px;" class="auto-style2"></div>
        <div id="show" style="display: none;">
            <h4>Welcome :</h4> 
            <p style="color: blue;" id="result_scan" runat="server"></p>
        </div>
    </div>
  
    <script>
        const html5Qrcode = new Html5Qrcode('reader');
        const qrCodeSuccessCallback = (decodedText, decodedResult) => {
            if (decodedText) {
                document.getElementById('show').style.display = 'block';
                document.getElementById('result_scan').textContent = decodedText;
                html5Qrcode.stop();
            }
        }
        const config = { fps: 10, qrbox: { width: 250, height: 250 } }
        /* html5Qrcode.start({ facingMode: "environment" }, config, qrCodeSuccessCallback);*/
        html5Qrcode.start({ facingMode: "user" }, config, qrCodeSuccessCallback);
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
       </div>
    </form>
</body>
</html>
 
 
 
 ฝัง asp ต้องเขียนโค๊ตประมานไหนครับ
 
 Code (VB.NET)
 
 Public Class test3
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Response.Write(result_scan)
            Dim x As String = ""
            x = Request.QueryString("result_scan")
        Else
            Response.Write(result_scan)
            Dim x As String = ""
            x = Request.QueryString("result_scan")
        End If
    End Sub
End Class
 
 
 Tag : ASP, HTML, Web (ASP.NET), VB.NET, IIS
 
 
 |  
            | 
 ประวัติการแก้ไข
 2024-09-27 10:53:28
 2024-09-27 10:56:01
 |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2024-09-27 10:50:50 | By :
                          puy4088 | View :
                          1256 | Reply :
                          1 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |