Transforming xml with server controls with xsl

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
bnyeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mmarinovConnect With a Mentor Commented:
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
 
mmarinovCommented:

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
 
bnyeAuthor Commented:
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
 
bnyeAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.