Home > Forum > C# > How to create spaces for in codebehind file in asp.net page

How to create spaces for in codebehind file in asp.net page

by Thamil   on Aug 25, 2013   Category: C#  |  Views: 3338    |  Points: 5   |  Gold 
  Reply
In the following code I want to put spaces in its output content like after BBA and before HSC so i am using nbsp tag but it is not giving me spaces so please help me
string strBody = "<html>" +
"<body>" +

"<div>Your name is: <b>" + txtaddress.Text + "</b></div>" +
"<div> your Gender:<b>"+txtgender.Text+"</b></div>"+
"<div> your skills:<b>" + txtskills.Text + "</b></div>" +
"<div> your experience:<b>" + txtexp.Text+ "</b></div>" +
"<div> your phno:<b>" + txtphno.Text + "</b></div>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td>1st Cell body data</td><td>2nd cell body data</td></tr></table>" +

"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>BBA<b> " + txtbba.Text + " </td><td>HSC<b>" + txtbbaclg.Text + "</td></tr></table>" +
"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>HSC<b> " + txthsc.Text + " </td><td>HSC<b>" + txthscclg.Text + "</td></tr></table>" +
"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>SSC<b> " + txtssc.Text + " </td><td>HSC<b>" + txtsscclg.Text + "</td></tr></table>" +
"Resume document generated successfully."+
"</body>" +
"</html>";

Questin posted on behalf of MuhammadShuaib Shaikh.

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :How to create spaces for in codebehind file in asp.net page   
by Thamil
on Aug 25 2013 4:17AM
Points : 10
Gold 
Hello MuhammadShuaib,

Please check with below updated code.

string strBody = "<html>" +
"<body>" +

"<div>Your name is: <b> "+txtaddress.Text +" </b></div>" +
"<div> your Gender:<b> "+txtgender.Text+" </b></div>" +
"<div> your skills:<b> "+txtskills.Text+" </b></div>" +
"<div> your experience:<b> "+txtexp.Text+" </b></div>" +
"<div> your phno:<b> "+txtphno.Text+" </b></div>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td align=\"center\">1st Cell body data</td><td align=\"center\">2nd cell body data</td></tr></table>" +

"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td width=\"50%\" align=\"center\">BBA   <b> "+txtbba.Text+" </td><td width=\"50%\" align=\"center\">HSC<b> "+txtbbaclg.Text+" </td></tr></table>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td width=\"50%\" align=\"center\">HSC   <b> "+txthsc.Text+" </td><td width=\"50%\" align=\"center\">HSC<b> "+txthscclg.Text+" </td></tr></table>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td width=\"50%\" align=\"center\">SSC   <b> " + txtssc.Text + " </td><td width=\"50%\" align=\"center\">HSC<b> " + txtsscclg.Text + " </td></tr></table>" +
"Resume document generated successfully." +
"</body>" +
"</html>";

Recent Post

Latest Posts