Hi ramco1917,
Please refer below sample.
HTML
Email:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox><br />
Password:
<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox><br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
<hr />
<asp:Label ID="lblJson" runat="server" />
Code
C#
protected void btnSubmit_Click(object sender, EventArgs e)
{
string body = "{" + string.Format(@"{2}""email"": ""{0}"",{2}""password"": ""{1}""{2}", txtEmail.Text, txtPassword.Text, Environment.NewLine) + "}";
lblJson.Text = body;
}
VB.Net
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim body As String = "{" & String.Format("{2}""email"": ""{0}"",{2}""password"": ""{1}""{2}", txtEmail.Text, txtPassword.Text, Environment.NewLine) & "}"
lblJson.Text = body
End Sub
Screenshot