How to add New Line

first line + something + second line

What i have to write to show the text in a new line in VB. I used system.environment.newLine but it did't work because I think it is for C#.

 thanks in advence for any reply...

0
Doboo
6/3/2007 9:36:38 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

8 Replies
653 Views

Similar Articles

[PageSpeed] 22
Get it on Google Play
Get it on Apple App Store

You could use vbCrLf but Environment.NewLine should work in any language.


Steve Wellens

My blog
0
SGWellens
6/3/2007 1:37:16 PM

if you mean a new line on the web page -  "<br />"


If a post helps to solve your problem, please click the Answer button on that post.

I'm still confused, but now I'm confused on a higher plane.
0
LockH
6/3/2007 2:12:35 PM
i test it in this code after clicking on a button: 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.Label1.Text = "First vbCrLf Second"

End Sub

and this what i got:

First vbCrLf Second

any body have an answer for this problem???

 
0
Doboo
6/3/2007 4:03:40 PM
Doboo:
i test it in this code after clicking on a button:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.Label1.Text = "First vbCrLf Second"

End Sub

and this what i got:

First vbCrLf Second

any body have an answer for this problem???

 

"First <br />  Second"

or maybe

"First" + vbCrLf  + "Second" ? 

 


If a post helps to solve your problem, please click the Answer button on that post.

I'm still confused, but now I'm confused on a higher plane.
0
LockH
6/3/2007 4:20:55 PM

I tried this one:

"First <br />  Second"

and it is working perfectly…

 

Thanks a lot Big Smile

0
Doboo
6/4/2007 3:36:02 AM

Environment.NewLine() must be work but change the property of text from single line to multiline


ASP.NET
0
yousef
3/15/2008 9:23:40 AM

hey hi u can use following code for working with newline..

it works properly. 

Protected Function FixCrLf(value As String) As String
   If
String.IsNullOrEmpty(value) Then Return String.Empty
   Return value.Replace(Environment.Newline, "<br />")
End Function

Now your databind would get changed to: 

<asp:Label ID="diaryEventBody" 
           runat="server" 
           Text='<%# FixCrLf(Eval("postEventFeedback")) %>' 
           Width="605px">
</asp:Label>
0
lakhan
3/15/2008 11:08:31 AM

the FixCrLf gives me a " Conversion from type 'DBNull' to type 'String' is not valid" error when the data is NULL.

 How can I get around it?

 I've tried :

       Protected Function FixCrLf(ByVal value As String) As String

       REM If String.IsNullOrEmpty(value) Then Return String.Empty

       If String.IsNullOrEmpty(value) Then Return ("")
        Return value.Replace(Environment.NewLine, "<br />")

      End Function

but my VB level is novice. Thanks in advance.
0
scokim
3/11/2009 1:34:34 AM
Reply:

Similar Artilces:

Can "Add Web Reference" if web service deployed to new web site, Can't add ref if deployed to Virt Server under Default web site (Sharepoint)
I have created a web service wich I can deploy successfully to a new IIS Web, but of course I have to set the port to something other than 80 (and I'd rather just use a virtual server under the Default web). If I try to deploy my web service under the Default Web as a new virtual server, and then try to "Add a web Reference" to the service, it fails with a 404: not found error. Notes: WServer 2003 My IIS server is running Sharepoint Portal Server (SPPS)sp2.  VS2005 Any ideas? /Bob C in GRR In Sharepoint Portal Admin I had to add a Path Exclusion.  Took me a whi...

Why don't I see the "use master page" check box when I add a new web form to my web app?
From what I've read I should see this check box whenever I add a new web form but I don't.  Should I add something else instead of a web form or is there a flaw in my web apps install? Woot! I found the answer!  There is an item in the add new item dialog box called web content form! If you use this instead of the web form then all is good and warm fuzzy!...

Newbie: cannot add a new web form ??
I just installed Visual Studio 2005 beta 2 and because I am new to asp.net I wanted to start easy with creating a new simple web form. The new item box was shown, Web Form highlighted, language is C#, default name not changed, just hit the Add Button, and all I can see is an error box that says:Object reference not set to an instance of an object.Can someone tell me what is going on. I can't do anything now in Asp.NET. A normal C# application works just fine.I am using Windows XP Professional. This has been solved in this post: http://forums.asp.net/903793/ShowPost.aspxwhich points t...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

How To Add A .NET component To PB11 Web Form
Hi all, I have an application migrated to PB11 web target, I have a .net reporting component written for .NET web forms, how can I add this to my form ? Thanks in advance. You cannot in PowerBuilder 11. Only .NET interop to non-visual components is supported. I'm presuming your 'reporting component' is some type of visual object you'd like to drop on the form? Support for visual components is slated for PowerBuilder 12. On 17 Jul 2007 04:14:32 -0700, "Alan Rechdan" <alan_reshdan@ipsos-stat.com> wrote: >Hi all, > > ...

add New Web Form in project run time
Hi              I want to add new  webform in a project .              But there is one problem. I want to add that .aspx page at run time.               Is it possible to add new  form run time in project. Thank you.  Nikunj RamwaniASP.NET Developer You can do that using HttpModule! you won't add a aspx page on the fly, but you can handle any request you want with HttpModule and...

How to add event to Web Form from the vs.net designer
 Hi there, I know that when i double click a web form I'm taking to the page_load event.  However, I want to create an unload event by I don't know how to create it from the vs.net designer.  Does anybody know how to create a page unload event from the vs.net designer? Many thanks  Page events are not exposed in the design view. If you are using VB, you should be able to use dropdowns on top of the code editor -> select Page in the left one and the designed event in the right one and editor will generate the code. Unfortunately, C# editor does not p...

unable to add a secure java web service to .net thru visual studio add web reference
I have a secure java web service running on my system.   I am able to successfully do a URL based invocation of it and also was able to get the expected SOAP response. It uses the Basic Authentication mechanism to make it secure. So basically when I type the URL in the address bar and invoke it, it asks me for a user name password, I enter it and it runs normally.  Now, when I try to add that web service to a simple asp.net web application thru visual studio add web reference mechanism, it first prompts with a certificate, which I accept and then prompts with Disco...

Entering data in old aspx form only after saving data in new web form opened in new window
Dear all, i am facing a problem. please solve it. i have created two .aspx pages, say, page1.aspx and page2.aspx. with the help of client-side javascript i am opening page2.aspx from page1.aspx in a new window. So, page1.aspx and page2.aspx remains open at the same time. what i want is, i don't want the user to able to activate or enter data in page1.aspx without saving data in page2.aspx. regards subhajit use window.showModalDialog() instead of window.open() when the child window is closed, in this case, program execution continues on the next line after the showModalDialog...

New Form
I need to create a form that will post to a different page outside of the portal Virtual directory, when I do this the form either postsback to itself or does nothing. how do I get this resolved? I need it to be a form because I don't want the address to display the info.. Example Don't want www.mydomain.com/mypage.asp?data1=one&data2=two Please helpKeith K. Kowalski There are a couple of problems when trying to add forms to your aspx pages. First of all, the reason .NET is able to do all of it's fancy-schmancy event handling is through the use of a big fat form. ...

Unspecified Error when trying to add a new web form to a project
I'm using Visual Studio 2002, a few days ago I decided to clean up most of my small test projects that I had created. By moving them to a CD (mostly ASP with VB ) The next day when I wanted to work further on one of my current projects I found out that I could not add a new web form, or usercontrol or anything to my project. All files that were in continued to work just fine. The same happened when I start to create a new project. I have looked for the VBProjectItems .vsz files, but they are still where they are supposed to be. I have uninstalled Visual Studio, the Framework 1.0 an...

Strange lines in new web.config (.NET 3.5)?
What do the lines below mean? They appeared in my .NET 2.0->.NET 3.5-project after the conversion. The new .NET 3.5 System.Web.Extensions is referenced to earlier in the assemblies section, so I can't figure out what these lines do? I dont want to remove them, "dependentAssembly" seems important. Does this mean I can't remove my old ASP.NET AJAX assemblies from GAC? Thanks in advance!<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions&qu...

Add New Item - Web Form
I am working on a new web site using Master Pages. I created my Master Page template just fine.Now I want to create a web page to use the template. It used to be that when you chose "Add New Item - Web Form" the dialog gave you an option to indicate that you want to use a master page and to select which one.But all that is gone. What happened to it? It just creates the web page from the standard template. There is no way to select a master page to use.And while it is no big deal to edit the header to use the master page, I am curious as to when and why the feature was removed...it was a conv...

How to Pass data to pop up form, allow user to add new value, pass new value back to form to do Insert
I have a grid view that shows the user the last meter readings (hours) for several generators. The meter readings need to be added daily.  I would like the user to be able to select the meter record from the grid view and have a pop up javascript form open that would allow the user to enter a new meter reading. Then after I do validation, do an insert of the new reading to the database. Is that a reasonable way of doing what I want? If not, can you give me a suggestion as to how to do it differently. Thanks. Hi..   Instead of opening window to ente...

How to add new web service extension for .net Framework 3.0
Hi all, I know that .net 2.0 uses aspnet_isapi.dll for web service extension. But for .net 3.0, I can't find the similar file. Can someone advise how to add web service extension for Framework 3.0? Thanks From Deploying an IIS-Hosted WCF Service: Windows XP SP2 and Windows Server 2003: Use the ServiceModelReg.exe tool to register WCF with IIS: To use this tool, type ServiceModelReg.exe /i /x at a command prompt. Windows Vista: Install the “Windows Communication Foundation Activation Components” subcomponent of the .NET Framework 3.0 using the Windows Component Wizard activat...

Web resources about - How to add New Line - asp.net.web-forms

Weather Line 1.1
Not one but two weather app recommendations today. And this one, Weather Line, has become my primary weather app. I find the temperate graph ...

Power Line
Every year for some time now, has selected an English Premier League team of the year. Last year, in my absence, a long-time reader made the ...

Line Rider - Wikipedia, the free encyclopedia
Originally appearing on DeviantArt on September 23, 2006, Line Rider quickly became an internet phenomenon. Line Rider is featured by several ...

Queensland licence plates dance a fine line of decency
Strict guidelines govern personalised plates, but some manage to cross the line.

V/Line passengers to receive compensation for severe disruptions
Passengers on V/Line services are expected to receive compensation following days of severe disruptions.

V/Line to provide free travel as compensation for disruptions
Travel will be free on V/Line trains and buses from this Saturday until the end of January as compensation for extreme disruptions that recently ...

Queensland number plates dance a fine line of decency
Strict guidelines govern personalised plates, but some manage to cross the line.

Oscars Boycott Not Likely to Shake Up ABC's Bottom Line
... Sharpton said Tuesday in a brief videotaped statement. "If we cannot change the hearts of Hollywood, we can at least change the bottom line." ...

'Squirmishing': The most mystifying lines of Sarah Palin's endorsement speech for Trump - Alaska Dispatch ...
Sarah Palin’s meandering, fiery, sarcastic, patriotic and blustery speech endorsing Donald Trump for president Tuesday in Ames, Iowa, does not ...

Banks line up to lure battered hybrid investors
Australia's big banks are lining up multibillion-dollar hybrid sales, but they'll be expected to pay record prices to attract investors that ...

Resources last updated: 1/21/2016 10:11:21 AM