Other issue to CK Editor

Peter_1985 2,586 Reputation points
2023-10-19T05:21:58.82+00:00

Hi,

To the thread below,

https://learn.microsoft.com/en-us/answers/questions/1389276/issue-to-ck-editor

regarding the last update in the following, how to refer to str within code behind?

User's image

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,418 questions
0 comments No comments
{count} votes

Accepted answer
  1. QiYou-MSFT 4,311 Reputation points Microsoft Vendor
    2023-10-26T07:51:42.2766667+00:00

    Hi @Peter_1985

    Use Signalr.

    1.Nuget installs Microsoft.owin and Microsoft.ASPNET.Signalr.Core.

    2.Create a SignalR Hub Class (v2).

     public class ChatHub : Hub
     {
         public void Send(string name, string message)
         {
            
             Clients.All.broadcastMessage(name, message);
         }
     }
    
    
    

    3.Create a OWIN Startup Class.

    namespace WebApplication9
    {
        public class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888
                app.MapSignalR();
            }
        }
    }
    
    

    4.Set your page as the start page

    Signalr

    5.Front-end code:

    <!DOCTYPE html>
    <html>
    <head>
        <title>SignalR Simple Chat</title>
        <style type="text/css">
            .container {
                background-color: #99CCFF;
                border: thick solid #808080;
                padding: 20px;
                margin: 20px;
            }
        </style>
    </head>
    <body>
        <script type="text/javascript" src="https://cdn.ckeditor.com/ckeditor5/40.0.0/classic/ckeditor.js"></script>
        <div class="container">
            <input type="text" id="message" />
            <input type="button" id="sendmessage" value="Send" />
            <input type="hidden" id="displayname" />
            <input type="hidden" id="messageinput" />
            <ul id="discussion">
            </ul>
        </div>
        <!--Script references. -->
        <!--Reference the jQuery library. -->
        <script src="Scripts/jquery-3.4.1.min.js" ></script>
        <!--Reference the SignalR library. -->
        <script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
        <!--Reference the autogenerated SignalR hub script. -->
        <script src="signalr/hubs"></script>
        <!--Add script to update the page and send messages.--> 
        <script type="text/javascript">
          
            $(function () {
                // Declare a proxy to reference the hub. 
                var chat = $.connection.chatHub;
                // Create a function that the hub can call to broadcast messages.
                chat.client.broadcastMessage = function (name, message) {
                  
                   
                    // Html encode display name and message. 
                    var encodedName = $('<div />').text(name).html();
                    var encodedMsg = $('<div />').text(message).html();
                    // Add the message to the page. 
                    $('#discussion').append('<li><strong>' + encodedName
                        + '</strong>:&nbsp;&nbsp;' + encodedMsg + '</li>');
                };
    
                // Get the user name and store it to prepend to messages.
                $('#displayname').val(prompt('Enter your name:', ''));
              
                // Set initial focus to message input box.  
                $('#message').focus();
    
                // Start the connection.
                $.connection.hub.start().done(function () {
                    $('#sendmessage').click(function () {
                        // Call the Send method on the hub. 
                        chat.server.send($('#displayname').val(), $('#message').val() );
                        // Clear text box and reset focus for next comment. 
                        $('#message').val('').focus();
                    });
                });
            });
        </script>
        
    </body>
    </html>
    

    User1

    Add ckeditor

    <!DOCTYPE html>
    <html>
    <head>
        <title>SignalR Simple Chat</title>
        <style type="text/css">
            .container {
                background-color: #99CCFF;
                border: thick solid #808080;
                padding: 20px;
                margin: 20px;
            }
        </style>
    </head>
    <body>
        <script type="text/javascript" src="https://cdn.ckeditor.com/ckeditor5/40.0.0/classic/ckeditor.js"></script>
        <div class="container">
            <input type="text" id="message" />
            <input type="button" id="sendmessage" value="Send" />
            <input type="hidden" id="displayname" />
            <input type="hidden" id="messageinput" />
            <ul id="discussion">
            </ul>
        </div>
        <!--Script references. -->
        <!--Reference the jQuery library. -->
        <script src="Scripts/jquery-3.4.1.min.js" ></script>
        <!--Reference the SignalR library. -->
        <script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
        <!--Reference the autogenerated SignalR hub script. -->
        <script src="signalr/hubs"></script>
        <!--Add script to update the page and send messages.--> 
        <script type="text/javascript">
            ClassicEditor
                .create(document.querySelector('#message'))
                .then(newEditor => {
                    editor = newEditor;
                })
                .catch(error => {
                    console.error(error);
                });
            $(function () {
                // Declare a proxy to reference the hub. 
                var chat = $.connection.chatHub;
                // Create a function that the hub can call to broadcast messages.
                chat.client.broadcastMessage = function (name, message) {
                    var str = editor.getData();
                   
                    // Html encode display name and message. 
                    var encodedName = $('<div />').text(name).html();
                    var encodedMsg = str ;
                    // Add the message to the page. 
                    $('#discussion').append('<li><strong>' + encodedName
                        + '</strong>:&nbsp;&nbsp;' + encodedMsg + '</li>');
                };
    
                // Get the user name and store it to prepend to messages.
                $('#displayname').val(prompt('Enter your name:', ''));
              
                // Set initial focus to message input box.  
                $('#message').focus();
    
                // Start the connection.
                $.connection.hub.start().done(function () {
                    $('#sendmessage').click(function () {
                        // Call the Send method on the hub. 
                        chat.server.send($('#displayname').val(), $('#message').val() );
                        // Clear text box and reset focus for next comment. 
                        $('#message').val('').focus();
                    });
                });
            });
        </script>
        
    </body>
    </html>
    
    
    

    User2

    Best regards,
    Qi You


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. QiYou-MSFT 4,311 Reputation points Microsoft Vendor
    2023-10-20T08:15:19.22+00:00

    Hi @Peter_1985

    I give you a solution:

    The str returned by ckeditor5 is with HTML tag.

    For example: You enter "Test" and it returns "<P>Test</p>."

    We add asp:ScriptManager (partial refresh) and asp:button asp:textbox to implement this. At the same time we hide this TextBox. Because it's a carrier.

      <asp:ScriptManager ID="ScriptManager1" runat="server">
           </asp:ScriptManager>
      <asp:UpdatePanel ID="updPanel" runat="server">
           <ContentTemplate>
      <asp:TextBox ID="TextBox1" runat="server" style="display:none" ></asp:TextBox>  
      <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" />
           </ContentTemplate>
          </asp:UpdatePanel>
    
    
    

    The principle is that each input comment is saved to the table and also assigned to the TextBox, a server control. Finally, Button, a server control, is responsible for the operation of saving the database on the backend.

    <%@ Page Title="相关资料" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Chat0._Default" ValidateRequest="false" %>
    <style>
    table, th, td {
      border:1px solid black;
    }
    </style>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!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 id="Head1" runat="server">
    
        <title>相关资料</title>
        <!--link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /-->
        <link rel="shortcut icon" type="image/x-icon" href="house_one.png" />
        <!--link rel="shortcut icon" type="image/png" href="house_one.png" /-->
        <link rel="stylesheet" type="text/css" href="StyleSheet1.css" />
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
        <link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
        <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=474OwxLkambWRwf8oWjOOECwD5j0ntj5"></script>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css" />
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js"></script>
        <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="JavaScript1.js">
        </script>
        <script language="C#" runat="server">
            private void clickMe(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(1); upd_pict_rec_id(2);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup();", true);
            }
            private void clickNo(object sender, EventArgs e)
            {
    
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup();", true);
            }
            private void clickMe2(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(2); upd_pict_rec_id(3);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup2();", true);
            }
            private void clickNo2(object sender, EventArgs e)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup2();", true);
            }
            private void clickMe3(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(3); upd_pict_rec_id(4);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup3();", true);
            }
            private void clickNo3(object sender, EventArgs e)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup3();", true);
            }
            private void clickMe4(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(4); upd_pict_rec_id(5);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup4();", true);
            }
            private void clickNo4(object sender, EventArgs e)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup4();", true);
            }
            private void clickMe5(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(5); upd_pict_rec_id(6);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup5();", true);
            }
            private void clickNo5(object sender, EventArgs e)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup5();", true);
            }
            private void clickMe6(object sender, EventArgs e)
            {
                //p1_Click(); remove_rec(6); 
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup6();", true);
            }
            private void clickNo6(object sender, EventArgs e)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup6();", true);
            }
        </script>
        <script type="text/javascript">
            jQuery(document).ready(function () {
                // 百度地图API功能
                var map = new BMap.Map("allmap");    // 创建Map实例
                map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);  // 初始化地图,设置中心点坐标和地图级别
                map.setCurrentCity("深圳");          // 设置地图显示的城市 此项是必须设置的
                map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
            });
        </script>
    
    </head>
    <body style="background-color: #C5C4CC;">
        <form id="form1" runat="server" autocomplete="off">
            <div>
                <table width="100%" align="right">
                    <!--tr>
                 <td align="right" style="background-color:#0A2757;height:1px;font-size:1px;">&nbsp;</td>
            </tr-->
                </table>
            </div>
            <br />
            <br />
            <div class="right up" />
            <asp:Label ID="Label1"
                Text="登记资料"
                Width="500px"
                Font-Names="標楷體"
                Font-Size="16pt"
                Font-Bold="true"
                ForeColor="Black"
                runat="server" />
            <br />
            <br />
            <br />
            <asp:Label ID="Label4"
                Text="谈话内容"
                Width="150px"
                Font-Names="標楷體"
                Font-Size="14pt"
                Font-Bold="true"
                ForeColor="Black"
                runat="server" />
            <script type="text/javascript" src="https://cdn.ckeditor.com/ckeditor5/40.0.0/classic/ckeditor.js"></script>
    
            <div id="dvDesc">
                <asp:Repeater ID="rptDesc" runat="server">
                    <ItemTemplate>
                        <table class="tblDesc" cellpadding="2" cellspacing="0" border="1">
                            <tr>
                                <td>
                                    <b>
                                        <u>
                                            <span class="cDesc"><%# Eval("cDesc") %></span>
                                        </u>
                                    </b>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <div>
               <ul id="CommentList" style="  list-style-position: inside;
    padding-left: 0;">
                 <li >评论 1:<br /><textarea id="Comment1" name="MyEA" runat="server" placeholder="Enter your Comment here ..."
            style="width: 250px;height: 100px;"></textarea></li>
                   <input type="button" name="Button1" value="新评论" id="addMore" class="forbutton" style="width: 140px;">
              </ul>
                <table id="table1" style="width:100%">
                    <tr>
                    <th>comment</th>
                    </tr>
                    
                </table>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                     </asp:ScriptManager>
                <asp:UpdatePanel ID="updPanel" runat="server">
                     <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server" style="display:none" ></asp:TextBox>  
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click1"  />
                     </ContentTemplate>
                    </asp:UpdatePanel>
                 
          </div>
          <script>
              ClassicEditor
                  .create(document.querySelector('#Comment1'))
                  .catch(error => {
                      console.error(error);
                  });
          </script>
            <script type="text/javascript">
                var i = 1;
                $(document).ready(function () {
                    //$('textarea[id*="currentComment"]').each(function () {
                    //$('textarea[id*="Comment"]').each(function () {
                    $("#addMore").click(function (e) {
                        i++;
                        $("#CommentList").append("<div id='div"+i+"'><textarea id='editor"+i+"' name='MyEA'  placeholder='Enter your Comment here ...' style = 'width: 250px;height: 100px;' ></textarea ></div> ");
                        ClassicEditor
                            .create(document.querySelector('#editor' + i))
                            .then(newEditor => {
                                editor = newEditor;
                            })
                            .catch(error => {
                                console.error(error);
                            });
    
                        var MyDiv = document.querySelector("#div" + i);
                        var bt = document.createElement("input");
                        bt.type = "button";
                        bt.value = 'submit';
                        bt.onclick = function () {                          
                            var str = editor.getData();
                            $("#table1").append("<tr><td>" + str + "</td></tr>");
                            var txtName = document.getElementById("<%=TextBox1.ClientID%>");
                           
                            txtName.value =  str;
                        };
                        MyDiv.appendChild(bt);
                       
    
     
                    });
                   
    
                });
            </script>
            <br />
            <br />
            <div id="allmap" style="width: 1150px; height: 320px; border: 2px double red; display: block"></div>
            <asp:Label runat="server" ID="lb_msg" Font-Size="Large" ForeColor="#E01B84" />
            <br />
            <br />
            <asp:Button ID="btnSave" type="button" runat="server" Width="140px" Text="储存" CssClass="forbutton" OnClick="btnSave_Click" />
            <asp:Button ID="btnCancel" type="button" runat="server" Width="140px" Text="取消" CssClass="forbutton" OnClick="btnCancel_Click" Visible="false" />
            <asp:Button ID="bt_temp" runat="server" Text="Call Button Click" Style="display: none" OnClick="pict_click6" />
            <br />
            <br />
        </form>
        <asp:Label ID="lb_msg2"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict1"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict2"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict3"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict4"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict5"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_pict6"
            CssClass="dia"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <button id="btnFind" style="visibility: hidden;">Find my location</button>
        <asp:Label ID="lb_var1"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_var2"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_var3"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_user_id"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_c_id"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_readonly"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
        <asp:Label ID="lb_house_id"
            Width="165px"
            Visible="false"
            Font-Names="標楷體"
            Font-Size="11pt"
            Font-Bold="true"
            ForeColor="Black"
            runat="server" />
    </body>
    </html>
    
    
    

    Since the data returned above comes with<P></P> so our content is the 4th to 5th from the bottom of the string.

     protected void Button1_Click1(object sender, EventArgs e)
     {
         char[] chs = TextBox1.Text.ToCharArray();
         char[] newchs = new char[chs.Length - 7];
         for(int i=3;i<chs.Length-4;i++)
         {
             newchs[i-3]= chs[i];
         }
         string str=new String(newchs);
         
     }
    

    Finally, this str is successfully passed from the front-end to the back-end.

    Best regards,
    Qi You


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. QiYou-MSFT 4,311 Reputation points Microsoft Vendor
    2023-10-25T07:06:25.2133333+00:00

    Hi @Peter_1985

    1.Determine who is currently logged in

    There are many ways to do this. I rented here for a simple identity verification. When the verification is successful, save the user information (UserName) to the Session and jump to the Default page.

     public partial class Login : System.Web.UI.Page
     {
         protected void Page_Load(object sender, EventArgs e)
         {
    
         }
    
         protected void Button1_Click(object sender, EventArgs e)
         {
             if(TextBox1.Text=="User"&&TextBox2.Text=="123456")
             {
                 Session["Name"] = TextBox1.Text;
    
                 Response.Redirect("Default.aspx", false);
             }
             if (TextBox1.Text == "User1" && TextBox2.Text == "123456")
             {
                 Session["Name"] = TextBox1.Text;
    
                 Response.Redirect("Default.aspx", false);
             }
         }
     }
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                UserName:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                Password<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" />
            </div>
        </form>
    </body>
    </html>
    
    
    
    1. Write code to let the GridView get the data of the database

    Since the user's comments are to be displayed in the table, we will do the information reading here.

     public void ReadComments()
     {
         SqlConnection conn = new SqlConnection("Data Source=LocalHost;Integrated Security=SSPI;Initial Catalog=Test;");
         conn.Open();
         string Sql = "select * from dbo.Comments";
         SqlCommand sqlCommand = new SqlCommand(Sql, conn);
         SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
         DataSet ds = new DataSet();
         sqlDataAdapter.Fill(ds);
         GridView1.DataSource = ds;
         GridView1.DataBind();
         conn.Close();
     }
    

    Since we just jump to this page to read, we need to write it in protected void Page_Load (object sender, EventArgs e).

    protected void Page_Load(object sender, EventArgs e)
    {
        ReadDate();
    }
    
    
    
    1. Submissions

    Since currently we can get the user's UserName and comment Str. So we can store it in a database.

     protected void Button1_Click1(object sender, EventArgs e)
     {
    
         char[] chs = TextBox1.Text.ToCharArray();
         char[] newchs = new char[chs.Length - 7];
         for (int i = 3; i < chs.Length - 4; i++)
         {
             newchs[i - 3] = chs[i];
         }
         string str = new String(newchs);
         TextBox1.Text = str;
         string name = Session["Name"].ToString();
         string Sql = "insert into dbo.Comments values('" + name + "','" + str + "')";
         SqlConnection conn = new SqlConnection("Data Source=LocalHost;Integrated Security=SSPI;Initial Catalog=Test;");
         conn.Open();
         SqlCommand sqlCommand = new SqlCommand(Sql, conn);
         int Count = Convert.ToInt32(sqlCommand.ExecuteNonQuery());
         conn.Close();
        
     }
    
    
    
    1. Real-time refresh

    Use asp:timer to refresh in real time so that we can dynamically see other people's comments.

     <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="always">
          <ContentTemplate>
     <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer>
    
    
    
    
     protected void Timer1_Tick(object sender, EventArgs e)
     {
         ReadDate();
     }
    
    
    

    Table:

    <asp:GridView ID="GridView1" runat="server"></asp:GridView>
    

    User

    Best regards,
    Qi You


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.