Solved

Transforming xml with server controls with xsl

Posted on 2004-04-23
4
227 Views
Last Modified: 2010-04-07
Experts -

I am having a bit of a logic block here. If transformed xml produces html and aspx displays html. Is it possible to have Server and/or User Controls in the XML doc that are then transformed and compiled all at the same time to output html (Like a DataGrid in the XML doc)? Perhaps I don't fully understand how this works? If someone could help make sense of this I would appreciate it. No rush just curious.

Regards,

bnye
0
Comment
Question by:bnye
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 10903105

actually you can do this ( i think, i'm not quite sure, because i haven't tested but:
1. The xsl get the xml and by some rules output a html code
2. If you dont want a code behind you can add to you xml <script language="VB" runat="server>server code</script>

if you want a code behind you can not do this in such way becase the browser can not compile the codebehind files

B...M
0
 

Author Comment

by:bnye
ID: 10903379
mmarinov -

Thanks for the response. So you think it is possible to add a server control (eg DataGrid or TextBox) to the XML doc and have it transform correctly?

example:

[code]
<asp:TextBox id="InputFormName" Runat="server"></asp:TextBox>
[/code]

How would I handle the when click event of...say...an   <asp:button>   if I don't have access to the code behind.

Thanks again for you response.

Regards,

bnye
0
 
LVL 28

Accepted Solution

by:
mmarinov earned 250 total points
ID: 10903491
here is an example taken from the MSDN
<%@ Page Language="VB" ClassName="FirstPageClass" %>

<html>
<head>
 
   <script runat="server">
      Public ReadOnly Property FirstName() As String
         Get
            ' first is the name of a TextBox control.
            Return first.Text
         End Get
      End Property

      Public ReadOnly Property LastName() As String
         Get
            ' last is the name of a TextBox control.
            Return last.Text
         End Get
      End Property

      Sub ButtonClicked(sender As Object, e As EventArgs)
         Server.Transfer("secondpage.aspx")
      End Sub

   </script>

</head>

<body>

   <form runat="server">
      First Name:
      <asp:TextBox id="first"
           runat="server"/>
      <br>
      Last Name:
      <asp:TextBox id="last"
           runat="server"/>
      <br>
      <asp:Button
           OnClick="ButtonClicked"
           Text="Go to second page"
           runat=server />
   </form>

</body>

there is no code behind
all is at the aspx page

B..M
0
 

Author Comment

by:bnye
ID: 10903655
mmarinov -

Thanks for the response. I am going to test it out tomorrow in the AM. I will award the points by Sunday if everything goes as planned. It looks as though it should be able to compile the Server controls on the client side at the very least. That would make my day if it could compile my User Controls as well.

Thanks again for the help,

bnye
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now