Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Transforming xml with server controls with xsl

Posted on 2004-04-23
4
230 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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.…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

789 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