asp .net & vb .net html rich text editor

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

Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

asp .net & vb .net html rich text editor

 
0
  #1
Jun 1st, 2004
Hey, this could go one of two ways. I want a rich text editor for my website, the information typed into the text editor will be saved to an sql server database under either char or varchar format that supports up to 8000 characters per field. I want it to save as html code. This content will then be pulled from the database to be displayed in a label. Now my question is, what is a good vb .net html rich text editor (must be free) OR how can I make one for vb .net (preferred).

Thanks guys, Slade.
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 28
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: asp .net & vb .net html rich text editor

 
0
  #2
Jul 19th, 2004
FreeTextBox. The one, the only, the best, free ASP.NET rich text box. Everyone uses this one; from the ASP.NET Forums to DotNetNuke.

And, by the way, consider using the ntext datatype to store it in SQL Server. You'll have enough room for 1073741823 characters, and it will be able to store unicode values.
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: asp .net & vb .net html rich text editor

 
0
  #3
Jul 19th, 2004
thats my problem Tek, I don't know how to work with text data types in a stored procedure and thats what I'm using to write to the table I really want to be able to do it though....
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 28
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: asp .net & vb .net html rich text editor

 
0
  #4
Jul 19th, 2004
Well, paste me whatcha got, and I'll help ya out ;-). By the way, stored procedures are the way to go when your working with web databases. They prevent nasty SQL Injection attacks, and are faster ;-). #Portal has over 150 stored procedures.
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: asp .net & vb .net html rich text editor

 
0
  #5
Jul 19th, 2004
Thanks Tekmaven, I'll post my t-sql code when I get home... and give you a little more info on what I need it to do. By the way, I'm thinking of installing the beta version of the asp .net forums... is it worth it? How long until it goes official?
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 28
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: asp .net & vb .net html rich text editor

 
0
  #6
Jul 19th, 2004
Originally Posted by slade
Thanks Tekmaven, I'll post my t-sql code when I get home... and give you a little more info on what I need it to do. By the way, I'm thinking of installing the beta version of the asp .net forums... is it worth it? How long until it goes official?
2.0 is nearly done, all thats missing is the 1.0 importer and language translations (i think... hehe.. but I do talk to one of the main developers a lot, and he's told me of some cooool stuff comming in 2.1..). And by the way, its not called the ASP.NET Forums anymore (to my surprise.. lol), its called Community Server, and its managed by »Telligent Systems, Inc. (the company which all the main Forums developers work for now ). Cool stuff :p .
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: asp .net & vb .net html rich text editor

 
0
  #7
Jul 21st, 2004
Sorry it's taken me so long to reply but I haven't been abel to get to my code, I'm flat out. So I'll just give you an example of what I'm trying to do:

I created this application at work, but it uses the same technique I'm trying to use on my website with the text data type... it just isn't working.

my TSQL
  1.  
  2. CREATE procedure JobAdd
  3. @PositionTitle nvarchar(50),
  4. @ReferenceNo nvarchar(10),
  5. @Location nvarchar(30),
  6. @ClosingDate smalldatetime,
  7. @JobDescription nvarchar(1000),
  8. @Requirements nvarchar(1000),
  9. @Email varchar(75),
  10. @JobID int output
  11. AS
  12. INSERT INTO JobVacancies
  13. (
  14. PositionTitle,
  15. ReferenceNo,
  16. Location,
  17. ClosingDate,
  18. JobDescription,
  19. Requirements,
  20. Email
  21.  
  22. )
  23. VALUES
  24. (
  25. @PositionTitle,
  26. @ReferenceNo,
  27. @Location,
  28. @ClosingDate,
  29. @JobDescription,
  30. @Requirements,
  31. @Email
  32.  
  33. )
  34. SELECT @JobID = @@IDENTITY
  35. GO
Something like that...

My vb .net code

 
PrivateFunction AddVacancyDetails() As Int32
 
Dim myConnection AsNew SqlConnection(ConfigurationSettings.AppSettings("strSqlConnectionString")) 
Dim myCommand = New SqlCommand("jobAdd", myConnection) 
myCommand.CommandType = CommandType.StoredProcedure 
 
Dim paramPosition As SqlParameter = myCommand.Parameters.Add("@PositionTitle", SqlDbType.NVarChar, 50) 
paramPosition.Value = txtPosition.Text 
 
Dim paramLocation As SqlParameter = myCommand.Parameters.Add("@Location", SqlDbType.NVarChar, 30) 
paramLocation.Value = txtLocation.Text
 
Dim paramClose As SqlParameter = myCommand.Parameters.Add("@ClosingDate", SqlDbType.SmallDateTime) 
paramClose.Value = dtClose.SelectedDate.ToShortDateString()
 
Dim paramRef As SqlParameter = myCommand.Parameters.Add("@ReferenceNo", SqlDbType.NVarChar, 4) 
paramRef.Value = txtRef.Text.ToUpper
 
Dim paramDescription As SqlParameter = myCommand.Parameters.Add("@JobDescription", SqlDbType.NVarChar, 1000) 
If txtJobDescription.Text = "" Then 
paramDescription.Value = DBNull.Value 
Else 
paramDescription.Value = txtJobDescription.Text 
EndIf
 
Dim paramRequirements As SqlParameter = myCommand.Parameters.Add("@Requirements", SqlDbType.NVarChar, 1000) 
If txtReq.Text = "" Then 
paramRequirements.Value = DBNull.Value 
Else 
paramRequirements.Value = txtReq.Text 
EndIf
 
Dim paramEmail As SqlParameter = myCommand.Parameters.Add("@Email", SqlDbType.VarChar, 75) 
Dim at AsString 
at = txtEmail.Text.IndexOf("@") 
If at = -1 Then 
paramEmail.Value = txtEmail.Text & "@goldenwest.org.au" 
Else 
paramEmail.Value = txtEmail.Text 
EndIf
 
Dim paramJobID As SqlParameter = myCommand.Parameters.Add("@JobID", SqlDbType.Int) 
paramJobID.Direction = ParameterDirection.Output 
myConnection.Open() 
myCommand.ExecuteNonQuery() 
Return Convert.ToInt32(paramJobID.Value)
 
EndFunction
 

This is just an app I made at work but it's the same way I'm trying to make my site except I want to use the text data type for the body

The above is to add a new article, I haven't tried that with the text data type because i haven't got past being able to populate the labels on the page with the information from the table. This is what I got for my stored procedure:

TSQL
  1. CREATE procedure jobGetDetails
  2. @JobID int,
  3. @PositionTitle nvarchar(50) output,
  4. @ReferenceNo nvarchar(10) output,
  5. @Location nvarchar(30) output,
  6. @ClosingDate smalldatetime output,
  7. @JobDescription nvarchar(1000) output,
  8. @Requirements nvarchar(1000) output,
  9. @Email varchar(75) output
  10.  
  11. AS
  12. SELECT
  13. @JobID = JobID,
  14. @PositionTitle = PositionTitle,
  15. @ReferenceNo = ReferenceNo ,
  16. @Location = Location,
  17. @ClosingDate = ClosingDate ,
  18. @JobDescription = JobDescription,
  19. @Requirements = Requirements,
  20. @Email = Email
  21. FROM JobVacancies
  22. WHERE JobID = @JobID
  23.  
  24. IF @@ROWCOUNT = 0
  25. SET @JobID = 0
  26. GO

I use the same way to populate the page except the other way around e.g.

PrivateSub ShowEdit(ByVal JobID As Int32)
 
Dim myConnection AsNew SqlConnection(ConfigurationSettings.AppSettings("strSqlConnectionString"))
Dim myCommand = New SqlCommand("jobGetDetails", myConnection)myCommand.CommandType = CommandType.StoredProcedure
 
Dim paramJobID As SqlParameter = myCommand.Parameters.Add("@JobID", SqlDbType.Int)
paramJobID.Value = JobID
 
Dim paramPosition As SqlParameter = myCommand.Parameters.Add("@PositionTitle", SqlDbType.NVarChar, 50)
paramPosition.Direction = ParameterDirection.Output

Dim paramRef As SqlParameter = myCommand.Parameters.Add("@ReferenceNo", SqlDbType.NVarChar, 4)
paramRef.Direction = ParameterDirection.Output

Dim paramLocation As SqlParameter = myCommand.Parameters.Add("@Location", SqlDbType.NVarChar, 30)
paramLocation.Direction = ParameterDirection.Output

Dim paramClose As SqlParameter = myCommand.Parameters.Add("@ClosingDate", SqlDbType.SmallDateTime)
paramClose.Direction = ParameterDirection.Output

Dim paramDescription As SqlParameter = myCommand.Parameters.Add("@JobDescription", SqlDbType.NVarChar, 1000)
paramDescription.Direction = ParameterDirection.Output

Dim paramReq As SqlParameter = myCommand.Parameters.Add("@Requirements", SqlDbType.NVarChar, 1000)
paramReq.Direction = ParameterDirection.Output

Dim paramEmail As SqlParameter = myCommand.Parameters.Add("@Email", SqlDbType.VarChar, 75)
paramEmail.Direction = ParameterDirection.Output

myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
 
txtPosition.Text = paramPosition.Value
txtRef.Text = paramRef.Value
txtLocation.Text = paramLocation.Value
txtEmail.Text = paramEmail.Value
 
If paramReq.Value Is DBNull.Value Then
txtReq.Text = ""
Else
txtReq.Text = paramReq.Value
EndIf

If paramDescription.Value Is DBNull.Value Then
txtJobDescription.Text = ""
Else
txtJobDescription.Text = paramDescription.Value
EndIf

dtClose.SelectedDate = paramClose.Value
txtEmail.Text = txtEmail.Text.Remove(txtEmail.Text.IndexOf("@"), 18)
 
If dtClose.SelectedDate < dtClose.TodaysDate Then
lblStatus.Text = "Status:" & "&nbsp;" & "Expired Vacancy"
Else
lblStatus.Text = "Status:" & "&nbsp;" & "Current Vacancy"
EndIf
EndSub
 

What happens is, when I try to create a stored procedure like above, I can't Save it because I get an error telling me I can't use the text data type as an argument.

I know all the code looks daunting lol, but it's not the actual application in question, just the technique I used.

Thanks for all your help tekmaven,

Slade
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 4
Reputation: SupportCuteSoft is an unknown quantity at this point 
Solved Threads: 0
SupportCuteSoft SupportCuteSoft is offline Offline
Newbie Poster

Re: asp .net & vb .net html rich text editor

 
0
  #8
Jul 29th, 2008
You can use RichTextBox which is very powerful and professional.
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC