Dynamically change HTML (PARAM) value in VB.NET

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    Did you create an HtmlGenericControl in your CodeBehind class that the
    client-side control could inherit?

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > I have an <OBJECT> control on my webform with the Id/Name of 'MyControl'.
    I
    > looked at the HTML and it has a bunch of PARAM values. The PARM value I
    want
    > to change is called "Value_21".
    >
    > How do I dynamically set this PARAM value through VB.NET code? (I want to
    > avoid ALL scripting if possible.)
    >
    > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > inaccessible through the codebehind.)
    >
    > Thanks.
    >
    >
    >

    Kevin Spencer Guest

  2. Similar Questions and Discussions

    1. Change Content Dynamically
      I'm trying to find a way to change the contents of a table (calendar) that I have nested in a DIV. without loading a new page. In other words, go...
    2. Change DataNavigateUrlField dynamically
      Hi guys, let's see if someone can give me a small hand with this.... i'm populating a dataset that sometimes changes 1 or 2 columns depending on...
    3. Dynamically change URL in Web Service
      Dear Al I am now also facing a problem on changing URL in web reference. Firstly, i added a web reference in my project, and then i change the...
    4. dynamically change
      I need to know how to modify the <asp:BoundColumn/> to N/A when the datafield value comes in as negative quantity and color it different on the...
    5. Change Param Tags Dynamically
      Does anyone know of a good way (any way, really) of changing <param> or <embed> tag value dynamically? This would be really incredibly helpful. Any...
  3. #2

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    Well, I tried this: "Dim MyControl as new HtmlGenericControl" (same name as
    the OBJECT). Is this what you mean? Can you clarify?

    BTW, putting "runat='server'" on this OBJECT creates some wierd GUID error
    so I had to remove this.

    "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > Did you create an HtmlGenericControl in your CodeBehind class that the
    > client-side control could inherit?
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > [url]http://www.takempis.com[/url]
    > Big things are made up
    > of lots of little things
    >
    > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > I have an <OBJECT> control on my webform with the Id/Name of
    'MyControl'.
    > I
    > > looked at the HTML and it has a bunch of PARAM values. The PARM value I
    > want
    > > to change is called "Value_21".
    > >
    > > How do I dynamically set this PARAM value through VB.NET code? (I want
    to
    > > avoid ALL scripting if possible.)
    > >
    > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > inaccessible through the codebehind.)
    > >
    > > Thanks.
    > >
    > >
    > >
    >
    >

    VB Programmer Guest

  4. #3

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    Here's the HTML for the OBJECT:
    <OBJECT id="MyNiKnob1" style="WIDTH: 144px; HEIGHT: 120px"
    Classid="clsid:D9..." name="MyNiKnob1" VIEWASTEXT>
    <PARAM NAME="_Version" VALUE="393218">
    <PARAM NAME="_ExtentX" VALUE="3810">
    <PARAM NAME="_ExtentY" VALUE="3175">
    <PARAM NAME="Value_21" VALUE="0">
    </OBJECT>

    Here's my Page_Load event (trying to change PARAM value 'Value_21'):
    Dim MyNiKnob As New HtmlGenericControl("MyNiKnob")
    MyNiKnob.Attributes.Add("Value_21", "64")

    Am I close?

    Robert

    "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > Did you create an HtmlGenericControl in your CodeBehind class that the
    > client-side control could inherit?
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > [url]http://www.takempis.com[/url]
    > Big things are made up
    > of lots of little things
    >
    > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > I have an <OBJECT> control on my webform with the Id/Name of
    'MyControl'.
    > I
    > > looked at the HTML and it has a bunch of PARAM values. The PARM value I
    > want
    > > to change is called "Value_21".
    > >
    > > How do I dynamically set this PARAM value through VB.NET code? (I want
    to
    > > avoid ALL scripting if possible.)
    > >
    > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > inaccessible through the codebehind.)
    > >
    > > Thanks.
    > >
    > >
    > >
    >
    >

    VB Programmer Guest

  5. #4

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    Try this (at the class level, along with the other field declarations):

    Protected MyControl As HtmlGenericControl

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    news:e6WGggvRDHA.1920@TK2MSFTNGP11.phx.gbl...
    > Well, I tried this: "Dim MyControl as new HtmlGenericControl" (same name
    as
    > the OBJECT). Is this what you mean? Can you clarify?
    >
    > BTW, putting "runat='server'" on this OBJECT creates some wierd GUID error
    > so I had to remove this.
    >
    > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > Did you create an HtmlGenericControl in your CodeBehind class that the
    > > client-side control could inherit?
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up
    > > of lots of little things
    > >
    > > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > > I have an <OBJECT> control on my webform with the Id/Name of
    > 'MyControl'.
    > > I
    > > > looked at the HTML and it has a bunch of PARAM values. The PARM value
    I
    > > want
    > > > to change is called "Value_21".
    > > >
    > > > How do I dynamically set this PARAM value through VB.NET code? (I want
    > to
    > > > avoid ALL scripting if possible.)
    > > >
    > > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > > inaccessible through the codebehind.)
    > > >
    > > > Thanks.
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  6. #5

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    I just reviewed your last message. You have to include the runat=server
    attribute in the tag in the page. The tag and the CodeBehind class must be
    the same. The id attribute of the tag must match the name you give to your
    field declaration. The Page inherits from the CodeBehind. I am able to
    create a server-side OBJECT tag. What error are you getting?

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    news:e6EoFEwRDHA.3132@tk2msftngp13.phx.gbl...
    > First, I tried this (in the Class level):
    > Protected MyNiKnob1 As HtmlGenericControl
    > An exception was thrown: Object reference not set to an instance of an
    > object.
    >
    > Then I tried this:
    > Protected MyNiKnob1 As New HtmlGenericControl("MyNiKnob1")
    > The value did not change.
    >
    > BTW, in Page_Load I still have: MyNiKnob1.Attributes.Add("Value_21", "64")
    >
    > Any ideas?
    >
    > Thanks again.
    >
    > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > news:eala79vRDHA.3880@tk2msftngp13.phx.gbl...
    > > Try this (at the class level, along with the other field declarations):
    > >
    > > Protected MyControl As HtmlGenericControl
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up
    > > of lots of little things
    > >
    > > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > > news:e6WGggvRDHA.1920@TK2MSFTNGP11.phx.gbl...
    > > > Well, I tried this: "Dim MyControl as new HtmlGenericControl" (same
    name
    > > as
    > > > the OBJECT). Is this what you mean? Can you clarify?
    > > >
    > > > BTW, putting "runat='server'" on this OBJECT creates some wierd GUID
    > error
    > > > so I had to remove this.
    > > >
    > > > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > > > news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > > > Did you create an HtmlGenericControl in your CodeBehind class that
    the
    > > > > client-side control could inherit?
    > > > >
    > > > > --
    > > > > HTH,
    > > > >
    > > > > Kevin Spencer
    > > > > .Net Developer
    > > > > Microsoft MVP
    > > > > [url]http://www.takempis.com[/url]
    > > > > Big things are made up
    > > > > of lots of little things
    > > > >
    > > > > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > > > > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > > > > I have an <OBJECT> control on my webform with the Id/Name of
    > > > 'MyControl'.
    > > > > I
    > > > > > looked at the HTML and it has a bunch of PARAM values. The PARM
    > value
    > > I
    > > > > want
    > > > > > to change is called "Value_21".
    > > > > >
    > > > > > How do I dynamically set this PARAM value through VB.NET code? (I
    > want
    > > > to
    > > > > > avoid ALL scripting if possible.)
    > > > > >
    > > > > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > > > > inaccessible through the codebehind.)
    > > > > >
    > > > > > Thanks.
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  7. #6

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    <object ..... >
    <asp:PlaceHolder id="phVersion" runat=server>
    ....
    </object>
    CODE-BEHIND...
    dim x as new Literalcontrol("<Param Name=""_Version"" Value=""" & some_Value
    & """>")

    phVersion.controls.add(x)



    "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    news:uMwwAkvRDHA.1624@tk2msftngp13.phx.gbl...
    > Here's the HTML for the OBJECT:
    > <OBJECT id="MyNiKnob1" style="WIDTH: 144px; HEIGHT: 120px"
    > Classid="clsid:D9..." name="MyNiKnob1" VIEWASTEXT>
    > <PARAM NAME="_Version" VALUE="393218">
    > <PARAM NAME="_ExtentX" VALUE="3810">
    > <PARAM NAME="_ExtentY" VALUE="3175">
    > <PARAM NAME="Value_21" VALUE="0">
    > </OBJECT>
    >
    > Here's my Page_Load event (trying to change PARAM value 'Value_21'):
    > Dim MyNiKnob As New HtmlGenericControl("MyNiKnob")
    > MyNiKnob.Attributes.Add("Value_21", "64")
    >
    > Am I close?
    >
    > Robert
    >
    > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > Did you create an HtmlGenericControl in your CodeBehind class that the
    > > client-side control could inherit?
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up
    > > of lots of little things
    > >
    > > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > > I have an <OBJECT> control on my webform with the Id/Name of
    > 'MyControl'.
    > > I
    > > > looked at the HTML and it has a bunch of PARAM values. The PARM value
    I
    > > want
    > > > to change is called "Value_21".
    > > >
    > > > How do I dynamically set this PARAM value through VB.NET code? (I want
    > to
    > > > avoid ALL scripting if possible.)
    > > >
    > > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > > inaccessible through the codebehind.)
    > > >
    > > > Thanks.
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    David Waz... Guest

  8. #7

    Default Re: Dynamically change HTML (PARAM) value in VB.NET

    "runat=server" doesn't work on my page for this control. It gives me this
    error:
    Parser Error
    Description: An error occurred during the parsing of a resource required to
    service this request. Please review the following specific parse error
    details and modify your source file appropriately.

    Parser Error Message: Guid should contain 32 digits with 4 dashes
    (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

    Source Error:


    Line 27: Be sure to substitute the GetKnobValue argument with the
    appropriate number.
    Line 28: -->
    Line 29: <OBJECT id="MyNiKnob1" runat=server style="WIDTH: 128px;
    HEIGHT: 112px" classid="clsid:D940E4D2-6079-11CE-88CB-0020AF6845F6"
    Line 30: name="MyNiKnob1" VIEWASTEXT>
    Line 31: <PARAM NAME="_Version" VALUE="393218">


    Source File: c:\inetpub\wwwroot\POWERWeb\OfficeViewAc.aspx Line: 29



    "David Waz..." <dlw@pickpro.com> wrote in message
    news:AlEPa.180$jd2.96932957@newssvr11.news.prodigy .com...
    > <object ..... >
    > <asp:PlaceHolder id="phVersion" runat=server>
    > ...
    > </object>
    > CODE-BEHIND...
    > dim x as new Literalcontrol("<Param Name=""_Version"" Value=""" &
    some_Value
    > & """>")
    >
    > phVersion.controls.add(x)
    >
    >
    >
    > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > news:uMwwAkvRDHA.1624@tk2msftngp13.phx.gbl...
    > > Here's the HTML for the OBJECT:
    > > <OBJECT id="MyNiKnob1" style="WIDTH: 144px; HEIGHT: 120px"
    > > Classid="clsid:D9..." name="MyNiKnob1" VIEWASTEXT>
    > > <PARAM NAME="_Version" VALUE="393218">
    > > <PARAM NAME="_ExtentX" VALUE="3810">
    > > <PARAM NAME="_ExtentY" VALUE="3175">
    > > <PARAM NAME="Value_21" VALUE="0">
    > > </OBJECT>
    > >
    > > Here's my Page_Load event (trying to change PARAM value 'Value_21'):
    > > Dim MyNiKnob As New HtmlGenericControl("MyNiKnob")
    > > MyNiKnob.Attributes.Add("Value_21", "64")
    > >
    > > Am I close?
    > >
    > > Robert
    > >
    > > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > > news:uJIPLcvRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > > Did you create an HtmlGenericControl in your CodeBehind class that the
    > > > client-side control could inherit?
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > .Net Developer
    > > > Microsoft MVP
    > > > [url]http://www.takempis.com[/url]
    > > > Big things are made up
    > > > of lots of little things
    > > >
    > > > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
    > > > news:#xZHuhuRDHA.3132@tk2msftngp13.phx.gbl...
    > > > > I have an <OBJECT> control on my webform with the Id/Name of
    > > 'MyControl'.
    > > > I
    > > > > looked at the HTML and it has a bunch of PARAM values. The PARM
    value
    > I
    > > > want
    > > > > to change is called "Value_21".
    > > > >
    > > > > How do I dynamically set this PARAM value through VB.NET code? (I
    want
    > > to
    > > > > avoid ALL scripting if possible.)
    > > > >
    > > > > (I did add "runat='server'" to the OBJECT tag, but it still seems
    > > > > inaccessible through the codebehind.)
    > > > >
    > > > > Thanks.
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    VB Programmer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139