Dynamically Creating Web Pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rohara
    New Member
    • Feb 2008
    • 2

    Dynamically Creating Web Pages

    Given a web form with a Rad Editor, I would like to be able to have this form create a new web page with the given text entered into the editor? I am not quite sure how to begin. The page will also have a ddl which the user can select which part of the menu the page will be sent to? Is there a way to do this or should I consider a new option?
  • VBWheaties
    New Member
    • Feb 2008
    • 145

    #2
    Originally posted by rohara
    Given a web form with a Rad Editor, I would like to be able to have this form create a new web page with the given text entered into the editor? I am not quite sure how to begin. The page will also have a ddl which the user can select which part of the menu the page will be sent to? Is there a way to do this or should I consider a new option?
    You can write the HTML code on every key press or Change event in the 'rad' editor. (RAD = Rapid Application Development?)

    What do you mean by DDL? Thats usually Data Definition Language among others. Or do you mean dynamic creation of HTML code?

    Comment

    • rohara
      New Member
      • Feb 2008
      • 2

      #3
      DDL = Drop Down List. This will be a asp.net web form which will have a Drop Down List which will list groups of pages for which you could save the page under. The only real thing that I need to know how to do is create a new web form from code behind or in the html source so that when you click a button it will create a web form with the text being what is typed in the Rad Editor. And the Rad Editor is a control which is developed by Telerik, but you can think of it as a complex text box.

      Comment

      • VBWheaties
        New Member
        • Feb 2008
        • 145

        #4
        Originally posted by rohara
        DDL = Drop Down List. This will be a asp.net web form which will have a Drop Down List which will list groups of pages for which you could save the page under. The only real thing that I need to know how to do is create a new web form from code behind or in the html source so that when you click a button it will create a web form with the text being what is typed in the Rad Editor. And the Rad Editor is a control which is developed by Telerik, but you can think of it as a complex text box.
        My approach would be to maintain an HTML string variable. Something with the starting HTML tag "<HTML>"

        Code:
        Public strHTML As String = "<HTML>"
        As the user types in the RAD, you could update the variable. You'd need to figure out how the RAD handles the events. In a regular textbox, there is a CHANGE event which fires when text changes. Also, there are keypress event, as well as Keyup, Keydown. So the choice is yours.

        Code:
            Private Sub RAD_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RAD.TextChanged
           strHTML = "<HTML>" & RAD.Text
            End Sub
        When they click the button to create the page, you would use StreamWriter object to output the HTML and save with an .HTML file extension.

        Code:
        Dim streamHTML As StreamWriter = New StreamWriter("MyHTML.HTML")
        streamHTML.Write strHTML & "</HTML>"
        As for webforms, that is ASP.net technology and I would be guessing. Best bet: post this to ASP.net to see if there is a better suggestion.
        Last edited by VBWheaties; Feb 25 '08, 07:20 PM. Reason: added Code examples, changed Textwriter to Streamwriter

        Comment

        Working...