DayWalker Posted November 3, 2003 Posted November 3, 2003 Starter question... How can i change the font and position of the output when i use response.Write in ASP.Net? The output is always at the top left of the page. Quote
Datahighway Posted November 3, 2003 Posted November 3, 2003 Hi DayWalker, you can use the HTML Tag. for exsample Response.Write("<br>") ' new Line 'Font Change Response.Write("<font size=7 face=verdana color=#00ff66>") Response.Write("My Test") Response.Write("</font>") Regards Datahighway Quote
devylzangel Posted November 3, 2003 Posted November 3, 2003 Depending on exactly what you are trying to do, you can use another method as well: Instead of using Response.Write, you can Import System.Text and use the StringBuilder to dynamically create a string of html. In the VB: Imports System.Text Public myhtml As String = String.Empty Dim mystring As StringBuilder = New StringBuilder() mystring.Append("htmlhere") mystring.Append("morehtmlhere") myhtml = mystring.ToString In the aspx/html, wherever you want the html and text to show up: <%=myhtml%> Quote
Moderators Robby Posted November 3, 2003 Moderators Posted November 3, 2003 Are you using Response.Write() to debug or for ? Quote Visit...Bassic Software
DayWalker Posted November 4, 2003 Author Posted November 4, 2003 No just as a welcome note on the top of the page that will display the user logged on.eg"ref=UID" Datahighway's syntax seems to be the easiest. I am new to ASP. Quote
Moderators Robby Posted November 4, 2003 Moderators Posted November 4, 2003 Stay away from these tags <%=myhtml%> whenever possible. Simply place a Label anywhere on the page and assign some text to it. Quote Visit...Bassic Software
irashkin Posted November 10, 2003 Posted November 10, 2003 "Stay away from these tags <%=myhtml%> whenever possible." Why? Just curious, thanks. Quote
*Gurus* Derek Stone Posted November 10, 2003 *Gurus* Posted November 10, 2003 With the ASP.NET model it is improper to inject logic into the Web pages themselves unless it is located in a script block. More appropriately code that modifies the page should be located in a code-behind. Granted the construct "<%=<string>%>" will be converted to a literal by the ASP.NET parser, thereby effectively yielding the same end result, but with a penalty to the readability of the application's code. Quote Posting Guidelines
irashkin Posted November 10, 2003 Posted November 10, 2003 thanks - that makes sense. what i hadn't realized, being pretty new to .net, is that the label tag can hold a whole string of html tags - I had always used it only for strings of text. So thanks for two answers in one! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.