5 Replies - 1123 Views - Last Post: 23 March 2011 - 12:24 AM Rate Topic: -----

#1 iry  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 17-September 07

How to get values from <object> tag

Posted 21 March 2011 - 09:01 PM

Hi, I've tried to search around in the forum and also google-ed it, but i couldn't find the way to do it.
hope someone can help me.

i have a form that will pass value to my web application(vb.net) using <object> tag, and what i need to do is to get those value from it on page load.

for example:

<object classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="info">
  <param name="txtField1" value="Someone's name" />
  <param name="txtField2" value="some value" />
  <param name="txtField3" value="some value" />
</object>




important info:
1. the number of parameter that will pass to my web application(vb.net) is dynamic
2. i need to know the param name and the value for that


is there any example, or anyone can give me an example how i could do this?

This post has been edited by iry: 21 March 2011 - 09:22 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to get values from <object> tag

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1997
  • View blog
  • Posts: 8,798
  • Joined: 29-May 08

Re: How to get values from <object> tag

Posted 22 March 2011 - 03:24 AM

The easiest way would be to use XML Literal + LINQ.

Do a search of Dream In Code for more examples.
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1997
  • View blog
  • Posts: 8,798
  • Joined: 29-May 08

Re: How to get values from <object> tag

Posted 22 March 2011 - 06:41 AM

Example
Module Module1

    Sub Main()
        Dim xml_sample = <objects>
                             <object classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="info">
                                 <param name="txtField1" value="Someone's name"/>
                                 <param name="txtField2" value="some value"/>
                                 <param name="txtField3" value="some value"/>
                             </object>
                             <object classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="info2">
                                 <param name="txtField1" value="Someone's name"/>
                                 <param name="txtField2" value="some value"/>
                                 <param name="txtField3" value="some value"/>
                             </object>

                         </objects>
        For Each o In xml_sample.<object>
            Console.WriteLine("Classid: {0}", o.@classid)
            Console.WriteLine("id: {0}", o.@id)
            Console.WriteLine("Params")
            For Each p In o.<param>
                Console.WriteLine("Name: {0} Value:{1}", p.@name, p.@value)
            Next
            Console.WriteLine()
        Next

    End Sub

End Module


Was This Post Helpful? 0
  • +
  • -

#4 iry  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 17-September 07

Re: How to get values from <object> tag

Posted 22 March 2011 - 06:37 PM

hi, thank you for your reply.
but my forms that going to pass value is not the same page and not even the same project with the web application that i going to retrieve the value.
in this case, is your code still work?
and.. your code need to place inside namespace?
Was This Post Helpful? 0
  • +
  • -

#5 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 561
  • View blog
  • Posts: 2,935
  • Joined: 19-May 09

Re: How to get values from <object> tag

Posted 22 March 2011 - 07:16 PM

You've given up on the idea of modifying your existing VB6 code?
Was This Post Helpful? 0
  • +
  • -

#6 iry  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 17-September 07

Re: How to get values from <object> tag

Posted 23 March 2011 - 12:24 AM

View PostBobRodes, on 22 March 2011 - 07:16 PM, said:

You've given up on the idea of modifying your existing VB6 code?


nope. actually i dont have the control to change it to vb.net
because the important part of that application is not belongs to me
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1