Dropdown menu using xml file

Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone please help me in converting this c# code to vb.net. I tried, but it is not giving the output. Here is the c# code

using System
using System.Collections
using System.ComponentModel
using System.Data
using System.Drawing
using System.Web
using System.Web.SessionState
using System.Web.UI
using System.Web.UI.WebControls
using System.Web.UI.HtmlControls
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
using System.IO;
using System.Text;

namespace MenuContro

    public class PageMenu :  System.Web.UI.UserControl
    {       
        protected Label MenuPlaceHolder;
        private string xmlFile = String.Empty;
        private string xslFile = String.Empty;
        public string XmlFileName
        {
            get { return(xmlFile); }
            set {xmlFile = value;}
        }
        public string XslFileName
        {
            get { return(xslFile); }
            set {xslFile = value;}
        }
        private void Page_Load(object sender, System.EventArgs e)
        {             
            string XmlSystemFileName = Server.MapPath(xmlFile);
            string XslSystemFileName = Server.MapPath(xslFile);
            XslTransform xslt = new XslTransform()
            xslt.Load(XslSystemFileName)
            XPathDocument xpathdocument = ne
            XPathDocument(XmlSystemFileName);           
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            xslt.Transform(xpathdocument, null, sw, null)
            MenuPlaceHolder.Text = sb.ToString();
        
        #region Web Form Designer generated cod
        override protected void OnInit(EventArgs e
        
            InitializeComponent()
            base.OnInit(e)
        
       
        private void InitializeComponent(
        {   
            this.Load += new System.EventHandler(this.Page_Load)
        
        #endregio
    



And here is the vb.net code that i converted. Anyone please tell me if this is correct or not

Imports Syste
Imports System.Collection
Imports System.ComponentMode
Imports System.Dat
Imports System.Drawin
Imports System.We
Imports System.Web.SessionStat
Imports System.Web.U
Imports System.Web.UI.WebControl
Imports System.Web.UI.HtmlControl
Imports System.Xm
Imports System.Xml.Xs
Imports System.Xml.XPat
Imports System.I
Imports System.Tex

Namespace MenuContro
    Public Class PageMen
        Inherits System.Web.UI.UserContro
        Protected MenuPlaceHolder As System.Web.UI.WebControls.Labe
        Private xmlFile As String = String.Empt
        Private xslFile As String = String.Empt
        Public Property XmlFileName() As Strin
            Ge
                Return (xmlFile
            End Ge
            Set(ByVal Value As String
                xmlFile = valu
            End Se
        End Propert
        Public Property XslFileName() As Strin
            Ge
                Return (xslFile
            End Ge
            Set(ByVal Value As String
                xslFile = valu
            End Se
        End Propert

        Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Loa
            Dim XmlSystemFileName As String = Server.MapPath(xmlFile
            Dim XslSystemFileName As String = Server.MapPath(xslFile
            Dim xslt As XslTransform = New XslTransform(
            xslt.Load(XslSystemFileName

            '//Instantiate the XPathDocument Clas
            Dim doc As XPathDocument = New XPathDocument(XmlSystemFileName

            '//Instantiate the XslTransform Clas
            Dim transform As XslTransform = New XslTransform(

            'XPathDocument xpathdocument = Ne
            'XPathDocument(XmlSystemFileName
            Dim sb As StringBuilder = New StringBuilder(
            Dim sw As StringWriter = New StringWriter(sb
            'xslt.Transform(XPathDocument, Nothing, sw, Nothing)
            transform.Load(XslSystemFileName)

            'xslt.Transform(doc
            MenuPlaceHolder.Text = sb.ToString()
        End Sub
#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region
    End Class
End Namespace


Your help will be greatly appreciated. Thanks for your help in advance.
0
anonymous (74722)
2/18/2004 2:41:06 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
901 Views

Similar Articles

[PageSpeed] 40

Reply:

Similar Artilces:

Publisher can't open files...
Conditions for the PC mentioned below: O/S: Wxp Pro - total updated. Office: Of2k - total updated. ****** Situation: I have received e-mails with publisher-files attached. When I try to open the files, my Publisher comes up with the error-message (translated from danish to english): "Publisher can't open files, which are created in another version of Publisher." When I look in the properties of the files, I can see the author's name, but not the version of the publisher, with which the files are created, or the Publisher-format of the files. (It should have been a goo...

Dropdown menu
How do I add a dropdown menu in my workbook? You can use Data Validation to create dropdown lists. There are instructions in Excel's help, and here: http://www.contextures.com/xlDataVal01.html keisha wrote: > How do I add a dropdown menu in my workbook? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Using IF statement
Excel 2003 Trying to write an IF statement in a particular cell and don't know i it's possible. I have the following example data in spoecified cells: B2: 131 B3: 130 B4: 131 B5: 138 B6: 139 Target Value Cell C1: 136 Is it possible to write a statement, in say cell D1, such that that th entire range of values B2 to B6 is compared to the target value in cel C1. For example, if *ANY* value in B2:B6 is less than the target the print "Yes", otherwise print "No". So for the case above a "No" should be the result. Obviously, it ca be done if the state...

how do you convert pagemaker files into publisher
I am trying to convert a pagemaker 7 brochure into a publisher format is this possible. I am using microsoft office pro 2003 You can try a copy and paste but there's no "conversion" available. -- JoAnn Paules MVP Microsoft [Publisher] "tupperwayne" <tupperwayne@discussions.microsoft.com> wrote in message news:C88A5D6E-EF51-4F1A-9965-B4BF71C6BB4A@microsoft.com... >I am trying to convert a pagemaker 7 brochure into a publisher format is >this > possible. I am using microsoft office pro 2003 ...

Windows cannot find file message
I have a strange problem when I try to open an Excel file from My Computer or Windows Explorer. I get an error message to the effect that "Windows cannot find the file c:\book1.xls' ,etc. etc. although the file definitey exists. Not too sure what I've done, but any help fixing this problem would be most gratefully received. One possibility is that the file is nested too deep in the filing system. There is a limit to the number of characters that can be used for a file path. For Excel I thing this is about 234; for Windows it is more. See if the name given in the "ca...

Using XML as a Database
I have a gigantic XML file which has the following structure: <root> <header> </header> <entry index="1">asdf</entry> <entry index="2">fdfsa</entry> ........ </root> Now, I have a simple XSD defined that automatically generates a Dataset for me. I use the MyDatabase.ReadXml method to read the xml into the Dataset. It fills the correct DataTables and DataRows automatically. I think this is an inefficient way of reading the XML. Is there a way I can do a query into my file so I can just grab my entry with ...

How do I create a dropdown within a dropdown?
I know how to create a dropdown list. On one or more of the items in that dropdown list, I would like to create another dropdown. How do I do this? The second list dependent on what was chosen in the first???? If you used Data|validation for your dropdown list, then you could visit Debra Dalgleish site: http://www.contextures.com/xlDataVal02.html Joyce Keller wrote: > > I know how to create a dropdown list. > On one or more of the items in that dropdown list, I would like to create > another dropdown. > How do I do this? -- Dave Peterson ...

DropDown
Need to be able to enter first several letters of a name and have the dropdown pick them up as I type in the name. Had it on a demo worksheet in my "learn" files BUT lost it somewhere. Please refer me to where I can pick up some samples to use.. Thank You.. Ensure the AutoWordSelect property of the combobox is set to true (default) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS www.nickhodge.co.uk "jlmccabes" <jlmccabes@cfl.rr.com> wrote in message news:kLxeh.9601$yj1.496@tornado.tampabay.rr.com... &...

HOW DO I WRITE A BOOK USING PUBLISHER?
I would like to start writing a book and I want to know if I can use Publisher 2003 to do that? Yes, unless you are creating the book in Braille. -- JoAnn Paules MVP Microsoft [Publisher] "Rhino" <Rhino@discussions.microsoft.com> wrote in message news:E992AAC1-7E26-4A55-B057-BB50074FD88F@microsoft.com... >I would like to start writing a book and I want to know if I can use > Publisher 2003 to do that? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.796 / Virus Database: 540 - Release Date: 11/13/...

Using Excel As Quickbooks Replacement
My mother-in-law doesn't want to pay for an upgrade to Quickbooks to manage her small rental/sales property business. Has anyone found it fairly easy to duplicate the effort in Excel so that one could just stick with that? Or, is there a template out there that you would recommend using to do this? I have not found an exact duplicate, but start looking in: http://office.microsoft.com/en-us/results.aspx?Scope=TC&Query=accounting for some ideas -- Gary's Student "99m@myway.com" wrote: > My mother-in-law doesn't want to pay for an upgrade to Quickbooks to >...

Use XSD to generate schema for only certain classes?
Hi, I have a number of classes in one assembly. I'd like to use XSD.exe to generate a schema for just one class ("Parse Rules") and its nested child classes. Is there an attribute that will allow me to do this? I tried running XSD on the entire assembly, with the plan to delete the unnecessary classes from the .xsd afterwords. However, it complained that a certain class "cannot be serialized because it does not have a default public constructor." (This was true, but irrelevant for my purposes -- I didn't need a schema for that particular class.) Also, is the...

In excel 2003, the menu bar and all toolbars disappear
In excel 2003, the menu bar and all toolbars disappear after I've been using the program for a period of time. It seems the only way to get them back is to stop and re-start excel. Tools|Customize|Toolbars tab Select the toolbars to show. Or View|Toolbars (to do one at a time) This'll help if they're just hidden/turned off. I'm not sure what disappear really means. JackCraig46 wrote: > > In excel 2003, the menu bar and all toolbars disappear after I've been using > the program for a period of time. It seems the only way to get them back is > to stop and...

Menu for Macros
I have a worksheet on which i have developed several macros that are associated with their own button. I am trying to develop a menu within the worksheet to place the buttons. Like a pop up menu, so that where ever I am in worksheet I can access buttons. I created menu called Macros with the new menu command on the toolbar; but I do not know how to limit it to just the worksheet I am using. Thanks for your help. Bob Leonard rleonard@mich.com You could put all the buttons on a User Form, brought up by a single button on the worksheet. If you know you will only need the macros on th...

Using Windows Backup?
Has anyone successfully used Windows built-in backup to backup and restore Exchange? Will this backup get all the correct information without stopping the services? The box in question is running Win2K Server and Exchange 2000. Thanks, Mike On Thu, 5 May 2005 20:59:17 -0600, "Mike G." <wet@dog.com> wrote: >Has anyone successfully used Windows built-in backup to backup and restore >Exchange? Will this backup get all the correct information without stopping >the services? The box in question is running Win2K Server and Exchange >2000. > >Thanks,...

News Menu Is Gone
Hi All, The "News" option is gone from the Go menu in Outlook 2003. I have read the help file on how to get it back, but it is also gone from the options menu! I can't find it anywhere. Has anyone seen this? Better yet, does someone know what to do about it? --Eric Read the newsgroup next time. There are countless posts on your question: To get the News command back, go back to the Programs tab in Control Panel | Internet Options and change the default newsreader to Outlook Express. If OE prompts you to make it your default newsreader the next time you launch it, clear the &q...

Using skins in dialogs
Hi, How are skins used in MFC dialog applications. When a skin is loaded on a dialog, certain areas of the skin should map to the various controls. For example, a circular shape in the skin should map to a button on the dialog, and give an impression that the button is circular in shape. How do I achieve these using VC++/MFC? Thanks, Sucharit I don't think there is anything built in to do automatic skinning in MFC. There have been articles written on the idea: http://www.codeproject.com/dialog/#Skins+%26+Advanced+UI If you are talking about using the WinXP theme support then you...

SQL Assistance
I wrote a SQL ('Select ... from ...') and would like the output to go to a txt file ('C:\DailySales.txt'). Can someone with more SQL knowledge tell me how I can send the output to a .txt file? Search group for OSQL command line arguments. "Luminox" <Luminox@discussions.microsoft.com> wrote in message news:0BFCAE60-4E48-417D-8158-569F1CBA2304@microsoft.com... >I wrote a SQL ('Select ... from ...') and would like the output to go to a > txt file ('C:\DailySales.txt'). Can someone with more SQL knowledge tell > me > how I can send...

Change tab color when a tab is used #2
Version 1 -- eluehman ----------------------------------------------------------------------- eluehmann's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1309 View this thread: http://www.excelforum.com/showthread.php?threadid=26242 you can only do this in office 2002 onwards. this goes into the sheet' code module. Private Sub Worksheet_Activate() Me.Tab.ColorIndex = 3 'this would give "Sheet1" a red underline End Sub i tried this, and i dont think it is too useful. as it is, when yo click on a tab, that tab's name is shown with a whit...

.jpg files slow to open
When logged on locally to a Windows 2003 machine it takes 5-10 seconds to open a .jpg and display the preview using the picture/fax viewer. Once it is open I can use the arrow keys to flip through other files at normal speed, it is only the initial opening that is slow. Watching in task manager I see that explorer.exe CPU shoots up to the 40-60% range as it works to open the file then drops back down to normal. I am troubleshooting another machine (Vista) that is having the exact same slow-to-open problem (when opening .jpg files stored on this server) which is what brought ...

DropDown Buttons
Hi, I need to create a drop down button that will show a drop down menu when a user clicks it then allow the user to select an option from the dorp down menue. This needs to be a stand alone button that can be placed anywhere and not a menu button that must be part of a menu. Here is a link to an image of the type of button I am wanting to create http://img126.imageshack.us/img126/2304/dropdownbutton9cp.jpg If anyone has any suggestions or knows of any good resources please post them up. Thanks in advanced, Ryan One way is to bring up a popup window when the button is clicked. Try th...

send/receive error message: outlook data file cannot be accessed
After many problems with my pc, I had to reformat my harddrive. i reinstalled Office 2010 Beta and now I can't send or receive email. it worked for the first hour or so, but now I get the error message. I researched on these forums for solutions and found some suggestions (delete all data and .pst files, etc.) but none have fixed my problem. I have tried creating a new data file from within Outlook and deleting all outlook data and .pst files, but still it says it cant be accessed. now that I think of it, all these problems may have started after I compacted my pst file....

Remove specific items from file name in folder
Greetings all- I have a directory that contains image files (lots of them) that all end with "_STD.jpg". I need to remove the "_STD" portion of all the file names, as well as return a count of all files processed. Any help would be much appreciated. "cjake2299" <cjake2299@gmail.com> screv in news:7db38b3f-38db-4d67-8cc9-2df11aa0d080@f18g2000prf.googlegroups.com... > Greetings all- > > I have a directory that contains image files (lots of them) that all > end with "_STD.jpg". I need to remove the "_STD" por...

Custom Paste function in Context Menu
Windows XP Home Is there any way to customise the context menu (the one obtained when the mouse is right clicked) to give it a "paste" function - eg to paste frequently used data such as an email address. donwb "donwb" <2banshee2@tiscali.co.uk> wrote in message news:uEAYEgUnKHA.1556@TK2MSFTNGP05.phx.gbl... > Windows XP Home > Is there any way to customise the context menu > (the one obtained when the mouse is right clicked) > to give it a "paste" function - > eg to paste frequently used data such as an email address. &g...

How do you name and use a custom Layout
I have a spreadsheet with 30 coloumns. Differnt users access this spreadsheet and depending on their login name I wanted to display a different layout for differnt users. I have tried using custom view but it does not work. I tried cutting and inserting the cut colomn into a differnt part of the spreadsheet and named the custom view, but it did not go to it from the default layout. In other words it appears you cannot use custom views to view different layout options -- Steve F Not sure how you are going to tell the system the login name. But the custom views should work. I start with...

Can not see the sub menu
Dear all i have a file in excel XP edition, which i was working till last week Rigth now i am openning the file but i cannot see all the menus EG. I want to hide a sheet, and i am going to the format, i can see the Sheet menu but i can not see the sub menu, where i can choose the hide option Can anyone help me with this? Regards Manos Manos, Long shot, but try this in the VBE immediate window commandbars("Worksheet Menu Bar").Controls("Format").controls("Sheet").enabled=true -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks ...