Solved

Transforming xml with server controls with xsl

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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