Variable replace in text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Todd Lu

    #1

    Variable replace in text

    I am trying to make a description in my ASP.NET form to be dynamic. I have
    a maintenance form that a description may be entered. I would like to add
    various sql table fields into the description so I can display the result on
    another form with all the text and values embedded from the sql table.

    I tried to add this text into the sql table and display it on a textbox but
    I am having some problems.

    ex: "Includes healthcare coverage from United Healthcare with a
    <%=Plan3Contrib utions%>,<%=Pla n2Contributions %> test."

    I can enter the <%=Plan3Contrib utions%> variables in the form and get my
    values but when I place the string into the <input.value> then i get the
    following result:

    ex: Includes healthcare coverage from United Healthcare with a , test.

    What would be a good way to try to embed sql fields into a form dynamically
    so I can give the user the flexibility to put whatever sql fields into the
    text area of my maintenence screen?

    Thanks

    Todd


  • pm

    #2
    RE: Variable replace in text

    I am not quite sure what you are actually trying to do, but some

    input.value = String.Format(" Includes healthcare coverage from United
    Healthcare with a {0}, {1} test.",Plan3Con tributions, Plan2Contributi ons);


    "Todd Lu" wrote:
    [color=blue]
    > I am trying to make a description in my ASP.NET form to be dynamic. I have
    > a maintenance form that a description may be entered. I would like to add
    > various sql table fields into the description so I can display the result on
    > another form with all the text and values embedded from the sql table.
    >
    > I tried to add this text into the sql table and display it on a textbox but
    > I am having some problems.
    >
    > ex: "Includes healthcare coverage from United Healthcare with a
    > <%=Plan3Contrib utions%>,<%=Pla n2Contributions %> test."
    >
    > I can enter the <%=Plan3Contrib utions%> variables in the form and get my
    > values but when I place the string into the <input.value> then i get the
    > following result:
    >
    > ex: Includes healthcare coverage from United Healthcare with a , test.
    >
    > What would be a good way to try to embed sql fields into a form dynamically
    > so I can give the user the flexibility to put whatever sql fields into the
    > text area of my maintenence screen?
    >
    > Thanks
    >
    > Todd
    >
    >
    >[/color]

    Comment

    • pm

      #3
      RE: Variable replace in text

      why not use String.Format.

      "Todd Lu" wrote:
      [color=blue]
      > I am trying to make a description in my ASP.NET form to be dynamic. I have
      > a maintenance form that a description may be entered. I would like to add
      > various sql table fields into the description so I can display the result on
      > another form with all the text and values embedded from the sql table.
      >
      > I tried to add this text into the sql table and display it on a textbox but
      > I am having some problems.
      >
      > ex: "Includes healthcare coverage from United Healthcare with a
      > <%=Plan3Contrib utions%>,<%=Pla n2Contributions %> test."
      >
      > I can enter the <%=Plan3Contrib utions%> variables in the form and get my
      > values but when I place the string into the <input.value> then i get the
      > following result:
      >
      > ex: Includes healthcare coverage from United Healthcare with a , test.
      >
      > What would be a good way to try to embed sql fields into a form dynamically
      > so I can give the user the flexibility to put whatever sql fields into the
      > text area of my maintenence screen?
      >
      > Thanks
      >
      > Todd
      >
      >
      >[/color]

      Comment

      • Todd Lu

        #4
        Re: Variable replace in text

        Thanks for the response. I was making it too hard on myself. I just use
        the replace function and all is well.

        Thanks,

        Todd
        "pm" <pm@discussions .microsoft.com> wrote in message
        news:00245F25-C491-4815-9225-03E3CE93E5EB@mi crosoft.com...[color=blue]
        > why not use String.Format.
        >
        > "Todd Lu" wrote:
        >[color=green]
        > > I am trying to make a description in my ASP.NET form to be dynamic. I[/color][/color]
        have[color=blue][color=green]
        > > a maintenance form that a description may be entered. I would like to[/color][/color]
        add[color=blue][color=green]
        > > various sql table fields into the description so I can display the[/color][/color]
        result on[color=blue][color=green]
        > > another form with all the text and values embedded from the sql table.
        > >
        > > I tried to add this text into the sql table and display it on a textbox[/color][/color]
        but[color=blue][color=green]
        > > I am having some problems.
        > >
        > > ex: "Includes healthcare coverage from United Healthcare with a
        > > <%=Plan3Contrib utions%>,<%=Pla n2Contributions %> test."
        > >
        > > I can enter the <%=Plan3Contrib utions%> variables in the form and get my
        > > values but when I place the string into the <input.value> then i get the
        > > following result:
        > >
        > > ex: Includes healthcare coverage from United Healthcare with a , test.
        > >
        > > What would be a good way to try to embed sql fields into a form[/color][/color]
        dynamically[color=blue][color=green]
        > > so I can give the user the flexibility to put whatever sql fields into[/color][/color]
        the[color=blue][color=green]
        > > text area of my maintenence screen?
        > >
        > > Thanks
        > >
        > > Todd
        > >
        > >
        > >[/color][/color]


        Comment

        Working...