Hi @Ashok Kumar ,
You can directly use the StringBuilder.Append
method to achieve similar functionality. You need to add the attribute runat="server"
to your div tag.
https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.append?view=net-7.0
<div id="DIV1" runat="server"></div>
StringBuilder sbHtml = new StringBuilder();
sbHtml.Append("<div class='dynamic'><h3 class='ui-title' role='heading' aria-level='1'>Dynamic div creating</h3></div>");
DIV1.InnerHtml = sbHtml.ToString();
Difference between Server Side Scripting and Client Side Scripting
The browser executes jquery. Use it when the browser has all the code. The source code is intended to be transmitted over the Internet from the web server to the user's computer and run directly on the browser. It is also used for validation and functionality of user events.
Web servers are used to execute server-side scripts. They are basically used to create dynamic pages. It can also access file systems residing on network servers.
Best regards,
Lan Huang
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.