Need help with form entry format

I am working in the following enviroment, please limit your answer to this: Visual Expres Web Development with Visual Basic.

One of my forms have a multiline textbox and its entry is save into a database. When the end user write anything, he would like to keep the same imput format. Like a margin, a blank line, etc. However, when information is retrieved from database, all this format is lost, and everything come up in a big paragraph.Without the original format it is hard to read specially when the paragraph are too long.

What should I do in order to keep the same format through out?

Thanks

0
vstorpedo
2/5/2008 10:57:34 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

13 Replies
361 Views

Similar Articles

[PageSpeed] 27

 

The problem is the custom input break your layout.

If you force the custom input did not change any your layout, you can use ifram to show the custom layout. 

So your layout or custom layout don't conflict each other. 

 

Regards 


Don't forget to click "Mark as Answer" on the post(s) that helped you.
0
TonyDong
2/6/2008 5:30:48 AM

 This is because line breaks and spaces aren't recognized by HTML as actual spaces. To make them display as they were entered, you can either wrap them in <pre> and </pre> tags, or do a replace on the strings, like so:

YourString = YourString.Replace("\n","<br />")
This replaces all newline characters with a HTML line break

YourString = YourString.Replace(" ","&nbsp;")
This replaces all space characters with a HTML non breaking space.

I don't use Visual Basic, I use C#, so my syntax mightn't be quite right, but you get the idea anyway Smile

 

0
bubblesnout
2/6/2008 6:04:12 AM

Of the two options that you are giving me. since to be that the first one is easy to implement. The one with <pre> </pre>. But I am having a hard time to implemented. In my understanding I have to place this code somewhere in the HTML of the display page, but where, since I do have a code that do not take this nested html code. My display code is as follow:

<asp:DetailsView ID="DetailsView3" runat="server" AutoGenerateRows="False" DataKeyNames="AutoNumber"

DataSourceID="SqlDataSource1" Height="50px" Width="816px" CellPadding="4" ForeColor="#333333">

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />

<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />

<Fields>

<asp:BoundField DataField="TListingComment" HeaderText="Listing Comment" />

</Fields>

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<EditRowStyle BackColor="#999999" />

<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

</asp:DetailsView>

0
vstorpedo
4/25/2009 12:31:34 AM

 I prefer you to use Editor control instead of placing textbox as Multiline , so it will considet HTML elements,the same has been stored and retrieve the data..

Some of the Editors are TinyMce , FreeTextbox , Fckeditor , WYSIWYG 

www.freetextbox.com

www.fckeditor.net


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
4/25/2009 5:01:35 AM

Ok, I tried, but it is only giving me three options: Multiline, single line or password. It does not take any of the options that you gave me. What should I do now?

Thanks

0
vstorpedo
4/25/2009 6:15:08 AM

Hi,

Try to read the data with HTMLEncode. This will be helpful to allow formatted user inputs.

HttpUtility.HtmlEncode(htmlInputTxt.Text));

Please let me know if this helps.

Thanks,

Thani

 


Tao of Jeet Kune Do
0
MisterFantastic
4/25/2009 6:22:31 AM

vstorpedo:
Ok, I tried, but it is only giving me three options: Multiline, single line or password. It does not take any of the options that you gave me. What should I do now?
 

Hai , the above i told editor its a control ie:DLL file (freetextbox, Fckeditor..) which you have include in your project tinymce editor its the best option. for tinymce_editor its fully Javascript based Editor.


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
4/25/2009 6:23:03 AM

I  think this cannot be achieved using a normal textbox unless users will type html in the textbox. If the users ll type html in the textbox, then use Server.HTMLEncode on the text.


Bind GridView to Dynamically created DataTable | Bind DataTable to DropDownList

My Blog
0
shahed
4/25/2009 8:07:55 AM

I downloaded and installed the FreeTextbox software, instalations instructions were followed and I think that everything is ok in relation to the software and instalation. But I am facing a small problem and since you used this software before you may have an idea of how to work it out. I tried to solved the problem in many differents ways but not luck. Here the problem:

By the way my plaform is Visual Basic and VWD Express Edition

Problem:

I do have a <asp:FormView> and inside there are differents controls for the user to fill and to be submitted to a database. The FreeTextbox control inside my form looks like this, but it is giving me error and can not run.: 

<FTB:FreeTextBox ID="CommentTextBox" runat="Server" Height="239px" Width="751px" Text='<%# Bind("TListingComment") %>' ></FTB:FreeTextBox>

As you can see the Text is Bind to a SQLDataSource for input into the database. But this code is giving me error. When I delete this part, "Text='<%# Bind("TListingComment") %>'" the FreeTextbox appears but for not good, because without the Bind code I can not enter the FreeTextBox data into the database. What should I do? any idea?

Thanks

 

 

 

0
vstorpedo
4/29/2009 4:59:03 AM

 Make sure have u did these steps..

 1) place the freetextbox.dll file on - Bin Folder of you project

 2) Add the tag on the page where you going to use editor control 

 ie: <@ Register ......,

3) Add that dll file on you toolbox so it looks like a control just drag and drop.

If you have any error let me know..?


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
4/29/2009 5:09:15 AM

venkatu2005:

 Make sure have u did these steps..

 1) place the freetextbox.dll file on - Bin Folder of you project

 

This part was done corretly. And according to my download file the correct name is Refresh.Web.FreeTextBox.dll file. 

venkatu2005:

 2) Add the tag on the page where you going to use editor control 

 ie: <@ Register ......,

 

This part was done correctly as well. As matter of fact my tag at the top of the page look like this:

<%@ Register TagPrefix="FTB" Namespace="Refresh.Web" Assembly="Refresh.Web.FreeTextBox"%> 

venkatu2005:

3) Add that dll file on you toolbox so it looks like a control just drag and drop.

This part was not done for two reasons. First, I do not know how to do it and second I think that this is optional. It is not necessary for the FreeTextbox to works. It is good to have it in the toolbox but in my understanding not necessary for it to works. Correct me if I am wrong.

Having said that, the FreeTextbox is not working due to the Bind text as I said in the post before. Any idea why?   

This is how the control code look like:

<FTB:FreeTextBox ID="CommentTextBox" runat="Server" Height="239px"

Width="751px" Text='<%# Bind("TListingComment") %>' ></FTB:FreeTextBox>

 

 

0
vstorpedo
4/29/2009 9:49:36 PM

vstorpedo:
Having said that, the FreeTextbox is not working due to the Bind text as I said in the post before. Any idea why?   
 

Yes, if you use the freetextbox - while you bind the data to freetextbox it has not bind in Some browser it may not work check it on both Mozilla , IE ... 

I already said its better to use  TinyMCE Editor control

here i have posted the link ..

http://www.dotnetspider.com/resources/27037-TinyMCE-Editor-Control.aspx


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
4/30/2009 4:58:42 AM

bubblesnout:

 This is because line breaks and spaces aren't recognized by HTML as actual spaces. To make them display as they were entered, you can either wrap them in <pre> and </pre> tags, or do a replace on the strings, like so:

YourString = YourString.Replace("\n","<br />")
This replaces all newline characters with a HTML line break

YourString = YourString.Replace(" ","&nbsp;")
This replaces all space characters with a HTML non breaking space.

I don't use Visual Basic, I use C#, so my syntax mightn't be quite right, but you get the idea anyway Smile

 

 I try to do what you are suggesting here but is not working:

This is my code, do you see any problem?

Dim CommentTextBoxToFixFormat As String = DirectCast(FormViewDataEntry.Row.FindControl("CommentTextBox"), TextBox).Text.ToString CommentTextBoxToFixFormat = CommentTextBoxToFixFormat.Replace("\n", " &lt; br /&gt; ")

DirectCast(FormViewDataEntry.Row.FindControl("CommentTextBox"), TextBox).Text = CommentTextBoxToFixFormat

 

 

When I use following code:  

CommentTextBoxToFixFormat = CommentTextBoxToFixFormat.Replace("a", "b")

in order to change all "a" for all "b" in order to see if this works, it does work, but not with \n an br />, what is the problem?

 

 

0
vstorpedo
5/3/2009 6:18:09 PM
Reply:

Similar Artilces:

Need HELP with adding a System.Windows.Forms control to web form!
Howdy folks. I'm in need of some help. I wanted to add a nifty little Control I made for a Windows Form to an ASP.NET page. Now I went and saw Microsoft's quickstart tutorial, and followed the example... You know, compile it to .dll... blah, blah, blah, then use the <OBJECT> tag to insert it into the page. Well, I did all that... the control downloads... but I can't see a thing! :'( For example, here's some code ~ using System; using System.Windows.Forms; using System.Drawing; using System.Reflection; [assembly:AssemblyVersion("1.0.0.0")] ...

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...

Really need help with disabled web forms in visual studio.net 2003
Hi, I've posted in the ASP.NET forum as someone suggested, but I got no response and am still unable to use the software. In Visual Studio .NET 2003, with .NET Framework 1.1, all web form controls (in fact all controls in the toolbar) are disabled. I create a webform.aspx page, I AM in design view, but when I go to the "web forms" toolbar, I cannot drag anything to the page because all the controls are disabled (the toolbar is visible, just everything within it is disabled). I solved this last time by completely wiping my drive and spending three days reinstalling and updating everythin...

Need Windows Form to Retrieve Information From Web Form
I have a cash and carry web site that customers can order products, the next day come in to the company to pay and pickup. I would like to create a windows application for the company to do two things: 1. download all the orders from the day before 2. upload price changes, product changes, category changes I've search the internet and forums and the only thing I can find that I think would actually link these two together would be a web service. Can you please tell me if I am heading in the right direction or if there is another method to link the two applications, if there are any pitf...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

need help with entry form?
i've made this entry form for the dungeons and dragons game. it works as far as sending by email, but the problem is that the stuff that you click on or type in from the 3rd line of the form does not show up when you click to send the results by email. please help me in fixing this entry form to have it all be sent and not partial. thanks. <html> <head> <title>MONSTER SUBMIT FORM</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <form ENCTYPE="text/plain" NAME="addform" M...

Need Web Form Help!!!
Ok here goes, I need to create an admin form that contains a list of events. This list, I was thinking about using a listbox, but the form needs the ability to select specific events and move them to another listbox. This new list will have to be saved in some way and then be displayed the next time the page is visited. Any ideas of how to accomplish this? Thanks in advance Brian That's a general question, so I'll provide you with a general answer. Create your two listboxes, one that is populated from the database and a blank one. The ideal solution here would be to move your items ...

help needed with Web forms
I am new to Web Application so please bear with me. I have a application where i have 2 3 web forms. I want to have a Page which will have link to these webforms and when user clicks on this the webform will open in the same page. It will be similar to frames where 1 frame have menu or links to these webforms and 2nd frame will open these webform when link is clicked. Could some one provide the easy code for this.  Thanks. This can be done by Master page, please take a look here http://aspnet.4guysfromrolla.com/articles/010505-1.aspxFarooq Kaiser, MCTS, MCPPlease Mark As Ans...

need help for web form
I have a one web form has two datagrid (master and detail)I have a master datagrid inside panel so i can have scroll bar. <asp:Panel ID="pnlsummarys" runat="server" Height="320" Width="100%" ScrollBars="auto"><asp:DataGrid ID="grdsummary" runat="server"><HeaderStyle BackColor="#42468E" Font-Bold="True" ForeColor="#F7F7F7" CssClass="ms-formlabel DataGridFixedHeader" /> <style type="text/css"> .DataGridFixedHeader { POSITION: relative; ; margin-top: 100px; TOP: expression(this.offsetParent.scrollTop); BACKGROUND-COLOR: white }</style> I use this styly sheet...

Need help with web forms
Hi,I am trying to make a web form that kinda works like the windows dataform.  I want to be able to take information from my table and display things in labels and textboxs, but have been having difficulty figuring out how to do this.  Does anyone have a suggestion of how I could make such a form that would be able to add new records, update records, delete records, or even make some inactive?  I also may need to show other related tables according to what the user is doing.  Say you are viewing a customer, so you want to be able to see all of that customers information, ...

how to place a <form> in web form form
i placed a <form> in the web form, but i can't submit coz i neet to submit to another web site how can i do??? Mike Chan You cannot submit a <form> to another page if you have a RunAt="Server" in the form tag. Remove that RunAt="Server" and you can (though then you will need to use plain old HTML inside that form). What are you trying to do? Why do you need to post to another form?Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog COZ I NEED TO POST SOME INFORMATION TO ANOTHER WEB SITE IS THERE ANY OTHER SOLUTION?M...

Need to prompt client with Print Dialog from IE; need some format to print web form content
Have you ever been on a website, and it will have a link or button to "Print Something", and when pressed, the Windows print dialog will automatically appear?  Well that is what I need to do.  I am guessing it must be some Javascript or something in .NET to do this.  So here are my questions. 1. How do I show the user a print dialog box from IE when they click on a link or button on my ASP.NET page? 2. The content I want to print is just a long set of instructions in an ASP.NET text box.  What would be the best product/format to put this in that can ...

Web resources about - Need help with form entry format - asp.net.web-forms

Format - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

IGA unveils new store format in bid to save the business
IN-HOUSE baristas, a gourmet “cheese master”, even a perfume counter. This is the future for IGA, and it’s pretty swanky — but is it enough to ...

AHL revamps their All-Star Game format, is it better than the NHL’s?
When talking about an exhibition game, you need to take any and all seriousness out of the tone you may be carrying. The All-Star Game is something ...

GOP candidates split on approach to change debate format - Videos - CBS News
Ben Carson leads Donald Trump and the rest of the Republican field in another national poll. It comes as some candidates are rejecting a new ...

Retro video format Betamax finally dies
It might be a surprise to many, but Sony has finally killed off its analogue video format Betamax.

Sony is finally killing its ancient Betamax format
Forty years after it was first introduced, Sony is finally putting Betamax out of its misery.

Christie Criticizes Upcoming Debate Format For Ignoring New Hampshire Voters
'I'll be in Milwaukee tomorrow night and I'll be on the stage where I'll get a lot more time to talk'

Fox Buys ‘Through My Eyes’ Thriller Based On Russian Format From ‘Fringe’ Producer
Fox has put in development Through My Eyes , a horror/thriller drama written/executive produced by former Fringe showrunner Joel Wyman and executive ...

Kitase speaks about Final Fantasy VII Remake's 'multi-part' format
Last weekend, at PlayStation Experience, Square Enix showed the first gameplay for the Final Fantasy VII Remake , and (according to our comments) ...

Worldwide large format printer shipments slip again in the 3Q15, says IDC
According to new data from the International Data Corporation (IDC ), large format printer (LFP) shipments declined 4% when compared to the third ...

Resources last updated: 12/13/2015 10:30:21 AM