943,752 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1195
  • ASP.NET RSS
Aug 10th, 2007
0

asp.net

Expand Post »
I have a string storing some data i want to display that data on
a aspx page how should i do it??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
virus220 is offline Offline
14 posts
since Aug 2007
Aug 11th, 2007
0

Re: asp.net

Click to Expand / Collapse  Quote originally posted by virus220 ...
I have a string storing some data i want to display that data on
a aspx page how should i do it??
I didnt get exactly what you are asking, but if you have a data stored in a string variable its so simple to display it in an aspx webpage:
Add a label control to your page, and name it for example Label1 then add the following code to your page_load event as bellow:

using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class InsertRecord : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strVar = "Hello World";
Label1.Text = strVar.ToString();
Response.Write(strVar.ToString());
}
}

Regards,
Khaled
Reputation Points: 10
Solved Threads: 0
Newbie Poster
atal is offline Offline
24 posts
since Jul 2007
Aug 11th, 2007
0

Re: asp.net

Thanx for reply and this do work but my problem is that i retrieved some data from a excel sheet using oledb commands but and stored it in a string but the data in excel sheet has text that is bold,italics have super-script involved but when i display it on web/win form that bold,italics.....etc features vanishes and i dont know how to deal with this problem any ideas???
Reputation Points: 10
Solved Threads: 0
Newbie Poster
virus220 is offline Offline
14 posts
since Aug 2007
Aug 12th, 2007
0

Re: asp.net

Click to Expand / Collapse  Quote originally posted by virus220 ...
Thanx for reply and this do work but my problem is that i retrieved some data from a excel sheet using oledb commands but and stored it in a string but the data in excel sheet has text that is bold,italics have super-script involved but when i display it on web/win form that bold,italics.....etc features vanishes and i dont know how to deal with this problem any ideas???
for formatting you should use HTML tags, like if you want to display a text as a bold add the bold tag to the string:

string strVar = "<b>Hello World</b>";
Label1.Text = strVar.ToString();
Response.Write(strVar.ToString());


Regards,
Khaled
Reputation Points: 10
Solved Threads: 0
Newbie Poster
atal is offline Offline
24 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Dropdown appears short in IE
Next Thread in ASP.NET Forum Timeline: Data Base format in dotnet





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC