Solved

Transforming xml with server controls with xsl

Posted on 2004-04-23
4
228 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

13 Experts available now in Live!

Get 1:1 Help Now