asp.net

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 14
Reputation: virus220 is an unknown quantity at this point 
Solved Threads: 0
virus220 virus220 is offline Offline
Newbie Poster

asp.net

 
0
  #1
Aug 10th, 2007
I have a string storing some data i want to display that data on
a aspx page how should i do it??
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 24
Reputation: atal is an unknown quantity at this point 
Solved Threads: 0
atal atal is offline Offline
Newbie Poster

Re: asp.net

 
0
  #2
Aug 11th, 2007
Originally Posted by virus220 View Post
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 14
Reputation: virus220 is an unknown quantity at this point 
Solved Threads: 0
virus220 virus220 is offline Offline
Newbie Poster

Re: asp.net

 
0
  #3
Aug 11th, 2007
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???
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 24
Reputation: atal is an unknown quantity at this point 
Solved Threads: 0
atal atal is offline Offline
Newbie Poster

Re: asp.net

 
0
  #4
Aug 12th, 2007
Originally Posted by virus220 View Post
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1030 | Replies: 3
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC