Jump to content

kwilliams

Members
  • Posts

    229
  • Joined

  • Last visited

Everything posted by kwilliams

  1. Wow, no replies. Well, I'll try again in a more straightforward manner:1) Can I use XForms with an ASP.NET transformation of XML/XSLT docs (see code in previous post)?2) If so, where would some good resources be of this setup?3) If not, what would be an alternative solution?Thanks for any help.
  2. I'm trying to learn about the use of XForms with XSLT, and I'm having some difficulties figuring it out. My site transforms an XML and XSLT doc into a resulting HTML doc using the following ASP.NET code: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %><%@ import Namespace="System.Web" %><%@ import Namespace="System.Web.UI" %><%@ import Namespace="System.Web.UI.WebControls" %><%@ import Namespace="System.Web.UI.HtmlControls" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Xml.Xsl" %><%@ import Namespace="System.Xml.XPath" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script language="vb" runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) xslTransform.DocumentSource = "xmldoc.xml" xslTransform.TransformSource = "xsldoc.xsl" End Sub</script><html><body><form id="form1" runat="server"> <div id="wrapper"> <asp:Xml id="xslTransform" runat="server"></asp:Xml> </div><!--end wrapper--></form></body></html> I want to create forms for the site, and I'd like to look into using XForms for this purpose. Is it the best solution for my setup? Also, if someone could point me in the right direction to some simple XForm examples, that would be great. Thanks.P.S. My site uses a XSLT 1.0 Processor.
  3. Hi jesh,I tried your suggestion, like this:FROM:<%@ Page Language="VB" MasterPageFile="~/NavMaster.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" title="Home" %>TO:<%@ Page Language="VB" MasterPageFile="~/NavMaster.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" title="Home" EnableViewState="false" %>...and it did change the page's size from 30890 bytes to 28690 bytes. But when I went to view the source code of the page, I still saw the View State, like this: ...<body> <form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm"><div><input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTgxMjAzNjcwZBgBBQtjdGwwMCRNZW51MQ8PZAUESG9tZWSjlkpjfcleQxf6aiJ4WDd9HnXDvA==" /></div>... Am I missing something?
  4. I used to have a set of PDF docs set up so that I could use the following example URL: http://www.mysite.com/dpcs/pdf/home.pdf#page=3 to pull up page 3 within a PDF document. For some reason, that feature has stopped working within all of my PDF documents. Is this "PDF anchor" option still available, or is there another way to accomplish this? I really like this feature, as it makes it easier for the user to browse through one central PDF doc without me having to literally break it up into smaller PDF's. So any help or advice would be greatly appreciated.
  5. Thanks for your honesty. I do appreciate it. I like the centrality of the Master Page control, but I find that it's built-in functions, although handy, are not easily flexible.I had created another solution that used XML/XSLT mostly with just a transformation on the ASP.NET page. But the problem I've run into with that solution is how to process input forms. I'm using XSLT on-the-server as opposed to on-the-client, so I thought that this solution would avoid the browser support issues. I like the way XForms works, and if I could use it with my XSLT on-the-server approach, that would be great. If you could let me know how I would go about processing that data once it's been entered and validated, that would be great also.If there is no way for me to use XForms, even with the XSLT on-the-server, then I'd also appreciate some other options being put forth by you or others. Thanks for any help.
  6. I'm creating a site that's going to use the ASP.NET Master Page Control to transform XML/XSLT data into the content section of an ASP.NET form. I've already created the basic setup for the site (code below), and some of the content, but I have a few questions/concerns about this method:What I don't like about the Master Page Control so far is the size of the pages. I haven't even put any content on the main section of the page, and it's already 31043 bytes in size. What are some steps that I can take to optimize this site (i.e. caching)? Also, how should I go about creating and processing a form within a transformed page using the Master Page control? Should I use XForms (like http://www.w3schools.com/xforms/default.asp) or dynamic ASP.NET server controls within XML (like http://www.dnzone.com/ShowDetail.asp?NewsId=151)?MASTER PAGE - NavMaster.master <%@ Master Language="VB" CodeFile="NavMaster.master.vb" Inherits="NavMaster" Debug="True" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Nav MasterPage</title> <link rel="stylesheet" type="text/css" media="screen" href="~/docs/css/screen.css" /></head><body> <form id="form1" runat="server"> <div id="wrapper"> <!-- Tab navigation --> <div id="tabs"> <asp:Menu id="Menu2" runat="server" StaticDisplayLevels="1" StaticSubMenuIndent="1" StaticMenuStyle-VerticalPadding="0" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False" StaticMenuItemStyle-HorizontalPadding="0" StaticMenuStyle-HorizontalPadding="0"> <Items> <asp:MenuItem NavigateUrl="default.aspx" ImageUrl="~/images/gif/tab1_active.gif" /> <asp:MenuItem NavigateUrl="~/aboutus/aboutus.aspx" ImageUrl="~/images/gif/tab2_active.gif" /> <asp:MenuItem NavigateUrl="~/depts/depts.aspx" ImageUrl="~/images/gif/tab3_active.gif" /> </Items> </asp:Menu> </div><!-- end tabs --> <div id="screenleft"> <asp:contentplaceholder id="LeftColumn" runat="server" /> </div><!-- end screenleft --> <div id="content"> <!-- dynamic page title --> <h1><asp:label id="lblPageTitle" runat="server" /></h1> <br /> <hr class="navyblueline" /> <!-- breadcrumbs --> <asp:SiteMapPath id="SiteMapPath1" Runat="Server" /> <br /><br /> <!-- page content --> <asp:contentplaceholder id="ContentColumn" runat="server" /> </div><!-- end content --> <div id="screenright"> <asp:ContentPlaceHolder id="RightColumn" runat="server"> <asp:Image ID="Ad1" ImageUrl="~/images/gif/ad1.gif" Runat="Server" /> <br /> <asp:Image ID="Ad2" ImageUrl="~/images/gif/ad2.gif" Runat="Server" /> </asp:ContentPlaceHolder> </div><!-- end screenright --> <div id="screenfooter"> This is the footer section </div><!-- end screenfooter --> </div><!-- end wrapper --> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> </form></body></html> SITEMAP - web.sitemap <?xml version="1.0" encoding="utf-8" ?><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"> <siteMapNode url="~/default.aspx" title="Home" description="Home"> <siteMapNode id="aboutus" url="~/aboutus/aboutus.aspx" title="About Us" description="About Us"> </siteMapNode> <siteMapNode url="~/depts/depts.aspx" title="Departments" description="Departments"> </siteMapNode> </siteMapNode></siteMap> ASP.NET PAGE - default.aspx <%@ Page Language="VB" MasterPageFile="~/NavMaster.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" title="Home Page" %><asp:Content ID="Content1" ContentPlaceHolderID="LeftColumn" Runat="Server"><!-- Leftnav buttons go here --><div id="screenleftnav"> <div class="leftheader">About Us</div><!-- end leftheader --> <ul> <li><a href="">Button 1</a></li> <li><a href="">Button 2</a></li> <li><a href="">Button 3</a></li> <li><a href="">more...</a></li> </ul> <div class="leftheader">Departments</div><!-- end leftheader --> <ul> <li><a href="">Button 4</a></li> <li><a href="">Button 5</a></li> <li><a href="">Button 6</a></li> <li><a href="">more...</a></li> </ul> <br /></div><!-- end screenleftnav --></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentColumn" Runat="Server"> This is the main content section. This is where the XML/XSLT transformation will take place.</asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="RightColumn" Runat="Server"><div id="screenright"> This is the right content section.</div><!-- end screenright --></asp:Content> VB.NET PAGE - default.aspx.vb Partial Class NavMaster Inherits System.Web.UI.MasterPage Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) lblPageTitle.Text = SiteMap.CurrentNode.Description End SubEnd Class RESULTING CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Douglas County, Kansas - Home</title> <link rel="stylesheet" type="text/css" media="screen" href="docs/css/screen.css" /> <style type="text/css"> .ctl00_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; } .ctl00_Menu1_1 { text-decoration:none; } .ctl00_Menu1_2 { } .ctl00_Menu2_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; } .ctl00_Menu2_1 { text-decoration:none; } .ctl00_Menu2_2 { } .ctl00_Menu2_3 { } .ctl00_Menu2_4 { padding:0px 0px 0px 0px; } .ctl00_Menu2_5 { padding:0px 0px 0px 0px; } </style></head><body> <form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm"> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTgxMjAzNjcwD2QWAmYPZBYCAgMPZBYEAg0PPCsADQIADxYCHgtfIURhdGFCb3VuZGdkDBQrAAIFAzA6MBQrAAIWEh4FVmFsdWUFBEhvbWUeCURhdGFCb3VuZGceCFNlbGVjdGVkZx4EVGV4dAUESG9tZR4LTmF2aWdhdGVVcmwFHC9NYXN0ZXJQYWdlU2l0ZS9kZWZhdWx0LmFzcHgeB0VuYWJsZWRnHgpTZWxlY3RhYmxlZx4HVG9vbFRpcAUESG9tZR4IRGF0YVBhdGgFHC9tYXN0ZXJwYWdlc2l0ZS9kZWZhdWx0LmFzcHgUKwAHBRcwOjAsMDoxLDA6MiwwOjMsMDo0LDA6NRQrAAIWEB8EBRBBYm91dCB0aGUgQ291bnR5HwEFEEFib3V0IHRoZSBDb3VudHkfBQUkL01hc3RlclBhZ2VTaXRlL2Fib3V0ZGMvYWJvdXRkYy5hc3B4HwgFEEFib3V0IHRoZSBDb3VudHkfBmcfB2cfCQUkL21hc3RlcnBhZ2VzaXRlL2Fib3V0ZGMvYWJvdXRkYy5hc3B4HwJnFCsAAgUDMDowFCsAAhYQHwQFCFByb2R1Y3RzHwEFCFByb2R1Y3RzHwUFJS9NYXN0ZXJQYWdlU2l0ZS9hYm91dGRjL3Byb2R1Y3RzLmFzcHgfCAUIUHJvZHVjdHMfBmcfB2cfCQUlL21hc3RlcnBhZ2VzaXRlL2Fib3V0ZGMvcHJvZHVjdHMuYXNweB8CZ2QUKwACFhAfBAULRGVwYXJ0bWVudHMfAQULRGVwYXJ0bWVudHMfBQUgL01hc3RlclBhZ2VTaXRlL2RlcHRzL2RlcHRzLmFzcHgfCAULRGVwYXJ0bWVudHMfBmcfB2cfCQUgL21hc3RlcnBhZ2VzaXRlL2RlcHRzL2RlcHRzLmFzcHgfAmcUKwACBQMwOjAUKwACFhAfBAUIU2VydmljZXMfAQUIU2VydmljZXMfBQUjL01hc3RlclBhZ2VTaXRlL2RlcHRzL3NlcnZpY2VzLmFzcHgfCAUIU2VydmljZXMfBmcfB2cfCQUjL21hc3RlcnBhZ2VzaXRlL2RlcHRzL3NlcnZpY2VzLmFzcHgfAmdkFCsAAhYQHwQFDkRpc3RyaWN0IENvdXJ0HwEFDkRpc3RyaWN0IENvdXJ0HwUFJS9NYXN0ZXJQYWdlU2l0ZS9kZXB0cy9kYy9kY19ob21lLmFzcHgfCAUORGlzdHJpY3QgQ291cnQfBmcfB2cfCQUlL21hc3RlcnBhZ2VzaXRlL2RlcHRzL2RjL2RjX2hvbWUuYXNweB8CZ2QUKwACFhAfBAUKRW1wbG95bWVudB8BBQpFbXBsb3ltZW50HwUFKy9NYXN0ZXJQYWdlU2l0ZS9kZXB0cy9hcy9wZS9lbXBsb3ltZW50LmFzcHgfCAUKRW1wbG95bWVudB8GZx8HZx8JBSsvbWFzdGVycGFnZXNpdGUvZGVwdHMvYXMvcGUvZW1wbG95bWVudC5hc3B4HwJnZBQrAAIWEB8EBRBMb2NhbCBHb3Zlcm5tZW50HwEFEExvY2FsIEdvdmVybm1lbnQfBQUqL01hc3RlclBhZ2VTaXRlL2xvY2FsX2dvdnQvbG9jYWxfZ292dC5hc3B4HwgFEExvY2FsIEdvdmVybm1lbnQfBmcfB2cfCQUqL21hc3RlcnBhZ2VzaXRlL2xvY2FsX2dvdnQvbG9jYWxfZ292dC5hc3B4HwJnZBQrAAIWEB8EBQ9PbmxpbmUgU2VydmljZXMfAQUPT25saW5lIFNlcnZpY2VzHwUFNC9NYXN0ZXJQYWdlU2l0ZS9vbmxpbmVfc2VydmljZXMvb25saW5lX3NlcnZpY2VzLmFzcHgfCAUPT25saW5lIFNlcnZpY2VzHwZnHwdnHwkFNC9tYXN0ZXJwYWdlc2l0ZS9vbmxpbmVfc2VydmljZXMvb25saW5lX3NlcnZpY2VzLmFzcHgfAmcUKwACBQMwOjAUKwACFhAfBAUHZUFsZXJ0cx8BBQdlQWxlcnRzHwUFLC9NYXN0ZXJQYWdlU2l0ZS9vbmxpbmVfc2VydmljZXMvZWFsZXJ0cy5hc3B4HwgFB2VBbGVydHMfBmcfB2cfCQUsL21hc3RlcnBhZ2VzaXRlL29ubGluZV9zZXJ2aWNlcy9lYWxlcnRzLmFzcHgfAmdkZAITDw8WAh8EBQRIb21lZGQYAQULY3RsMDAkTWVudTEPD2QFBEhvbWVkXp6pLJa+v0aDYZ0Mw0FTTM5KeMs=" /> </div> <script type="text/javascript"> <!-- var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } // --> </script> <script src="/MasterPageSite/WebResource.axd?d=KKLQ16-PAjSAdMyUqtO2OA2&t=632996128439938112" type="text/javascript"></script> <script src="/MasterPageSite/WebResource.axd?d=9YVgtnxkl_EC7ZeDVABhuQ2&t=632996128439938112" type="text/javascript"></script> <div id="wrapper"> <!-- Tab navigation --> <div id="tabs"> <a href="#ctl00_Menu2_SkipLink"><img alt="Skip Navigation Links" src="/MasterPageSite/WebResource.axd?d=C877-NPBnLlA_xyeDHjJzA2&t=632996128439938112" width="0" height="0" style="border-width:0px;" /></a> <table id="ctl00_Menu2" class="ctl00_Menu2_5 ctl00_Menu2_2" cellpadding="0" cellspacing="0" border="0"> <tr> <td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="ctl00_Menu2n0"> <table class="ctl00_Menu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="white-space:nowrap;"><a class="ctl00_Menu2_1 ctl00_Menu2_3" href="default.aspx"><img src="images/gif/tab1_active.gif" alt="" style="border-style:none;vertical-align:middle;" /></a></td> </tr> </table> </td> <td style="width:3px;"></td> <td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="ctl00_Menu2n1"> <table class="ctl00_Menu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="white-space:nowrap;"><a class="ctl00_Menu2_1 ctl00_Menu2_3" href="aboutus/aboutus.aspx"><img src="images/gif/tab2_active.gif" alt="" style="border-style:none;vertical-align:middle;" /></a></td> </tr> </table> </td> <td style="width:3px;"></td> <td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="ctl00_Menu2n2"> <table class="ctl00_Menu2_4" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="white-space:nowrap;"><a class="ctl00_Menu2_1 ctl00_Menu2_3" href="depts/depts.aspx"><img src="images/gif/tab3_active.gif" alt="" style="border-style:none;vertical-align:middle;" /></a></td> </tr> </table> </td> </tr> </table> <a id="ctl00_Menu2_SkipLink"></a> </div><!-- end tabs --> <div id="screenleft"> <!-- Leftnav buttons go here --> <div id="screenleftnav"> <div class="leftheader">About Us</div><!-- end leftheader --> <ul> <li><a href="">Button 1</a></li> <li><a href="">Button 2</a></li> <li><a href="">Button 3</a></li> <li><a href="">more...</a></li> </ul> <div class="leftheader">Departments</div><!-- end leftheader --> <ul> <li><a href="">Button 4</a></li> <li><a href="">Button 5</a></li> <li><a href="">Button 6</a></li> <li><a href="">more...</a></li> </ul> <br /> </div><!-- end screenleftnav --> </div><!-- end screenleft --> <div id="content"> <!-- dynamic page title --> <h1><span id="ctl00_lblPageTitle">Home</span></h1> <br /> <hr class="navyblueline" /> <!-- breadcrumbs --> <span id="ctl00_SiteMapPath1"><a href="#ctl00_SiteMapPath1_SkipLink"><img alt="Skip Navigation Links" height="0" width="0" src="/MasterPageSite/WebResource.axd?d=C877-NPBnLlA_xyeDHjJzA2&t=632996128439938112" style="border-width:0px;" /></a><span>Home</span><a id="ctl00_SiteMapPath1_SkipLink"></a></span> <br /><br /> <!-- page content --> This is the main content section </div><!-- end content --> <div id="screenright"> <div id="screenright"> This is the right content section </div><!-- end screenright --> <div id="screenfooter"> This is the footer section </div><!-- end screenfooter --> </div><!-- end wrapper --> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWDQLLxL+WBgLIi9OIAQLf6Ie+DQLdgvPlDQKO1LKcCwLb4MClDQLggdHzAwLb4MClDQLggdHzAwLb4MClDQLggdHzAwLb4MClDQLggdHzAxNB1ZKW3G9fVbk/8m+rafTOxMR4" /></div><script type="text/javascript"> <!-- var ctl00_Menu1_Data = new Object(); ctl00_Menu1_Data.disappearAfter = 5; ctl00_Menu1_Data.horizontalOffset = 0; ctl00_Menu1_Data.verticalOffset = 0; var ctl00_Menu2_Data = new Object(); ctl00_Menu2_Data.disappearAfter = 500; ctl00_Menu2_Data.horizontalOffset = 0; ctl00_Menu2_Data.verticalOffset = 0; // --></script></form></body></html>
  7. I'm using the ASP.NET Master Page control for my site with the use of this tutorial: http://msdn.microsoft.com/library/default....masterpages.asp, and I'm running into a few small issues with the use of the Web.sitemap doc. The code below results in about a 10px gap between each button image on the top nav. It also results in a blank button above the "Home" button, and all of the items from Web.sitemap are listed in the left nav. Here's some examples:This is how the top nav appears:Home About Us Contact Us...and this is how I want the top nav to appear:Home About Us Contact UsThis is how the left nav appears:Home About Us Products Services Contact Us...and this is how I want the left nav to appear:About Us (header for buttons - not a button)Products (button)Services (button)So my questions are:1) How can I remove the indention between the top horizontal nav buttons?2) How can I remove the empty button at the top of the left nav?3) How can I filter Web.sitemap so that only the "About Us" items appear in the left column?------------------------------------------------------------------------------NavMaster.master:<%@ Master Language="VB" CodeFile="NavMaster.master.vb" Inherits="NavMaster" Debug="True" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Nav MasterPage</title> <link rel="stylesheet" type="text/css" media="screen" href="~/docs/css/screen.css" /></head><body> <form id="form1" runat="server"> <div id="wrapper"> <!-- Tab navigation --> <div id="tabs"> <asp:Menu id="Menu2" runat="server" StaticDisplayLevels="1" StaticSubMenuIndent="1" StaticMenuStyle-VerticalPadding="0" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"> <Items> <asp:MenuItem NavigateUrl="default.aspx" ImageUrl="~/images/gif/tab1_active.gif" /> <asp:MenuItem NavigateUrl="aboutus.aspx" ImageUrl="~/images/gif/tab2_active.gif"> <asp:MenuItem Text="Products" Value="Products"></asp:MenuItem> <asp:MenuItem Text="Services" Value="Services"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem NavigateUrl="contactus.aspx" ImageUrl="~/images/gif/tab3_active.gif"> </Items> </asp:Menu> </div><!-- end tabs --> <div id="screenleft"> <asp:contentplaceholder id="LeftColumn" runat="server" /> </div><!-- end screenleft --> <div id="content"> <!-- dynamic page title --> <h1><asp:label id="lblPageTitle" runat="server" /></h1> <br /> <!-- page content --> <asp:contentplaceholder id="ContentColumn" runat="server" /> </div><!-- end content --> <div id="screenfooter"> This is the footer section </div><!-- end screenfooter --> </div><!-- end wrapper --> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> </form></body></html>------------------------------------------------------------------------------NavMaster.aspx.vb:Partial Class NavMaster Inherits System.Web.UI.MasterPage Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) lblPageTitle.Text = SiteMap.CurrentNode.Description End SubEnd Class------------------------------------------------------------------------------Web.sitemap:<?xml version="1.0" encoding="utf-8" ?><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"> <siteMapNode url="~/default.aspx" title="Home" description="Home"> <siteMapNode id="aboutus" url="aboutus.aspx" title="About Us" description="About Us"> <siteMapNode url="products.aspx" title="Products" description="Products" /> <siteMapNode url="services.aspx" title="Services" description="Services" /> </siteMapNode> <siteMapNode id="contactus" url="contactus.aspx" title="Contact Us" description="Contact Us" /> </siteMapNode></siteMap>------------------------------------------------------------------------------aboutus.aspx:<%@ Page Language="VB" MasterPageFile="~/NavMaster.master" AutoEventWireup="false" CodeFile="aboutus.aspx.vb" Inherits="aboutus_aboutus" title="About Us" %><asp:Content ID="Content1" ContentPlaceHolderID="LeftColumn" Runat="Server"> <div id="screenleftnav"> <asp:Menu id="Menu1" Runat="Server" DataSourceID="SiteMapDataSource1" StaticDisplayLevels="2" DisappearAfter="5" StaticEnableDefaultPopOutImage="False" /> </div></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentColumn" Runat="Server"> This is the main content section</asp:Content>
  8. I've been using the following ASP/VB email code for some time with no problems: <%Response.Buffer = trueSet objSendMail = Server.CreateObject("CDO.Message") With objSendMail .To = "you@mysite.com" .From = "me@mysite.com" .Subject = "Hello World!" .HTMLBody = "<font face='arial' size='2'>Hello everyone.</font>" .Importance = 2 'cdoHigh .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "MAILSERVERNAME" .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Configuration.Fields.Update .Send End WithSet objSendMail = Nothing%> But now I'm receiving this error message concerning the "Importance":Microsoft VBScript runtime error '800a01b6'Object doesn't support this property or method: 'Importance'/HelpDesk/bgscripts/testemail.asp, line 14Besides ".Importance = 2", I've tried the following other options I've seen from several sites without success:.Fields.Item(cdoImportance) = 2.Configuration.Fields.Item("urn:schemas:mailheader:X-Priority") = 1 .Fields.Item("urn:schemas:httpmail:importance").Value = cdoHigh.Fields("urn:schemas:httpmail:importance").Value = 2.Fields.Item("urn:schemas:httpmail:importance").Value = 2 'cdoHigh.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High".Configuration.Fields.Item("urn:schemas:mailheader:X-Priority") = 3.Configuration.Fields.Item("urn:schemas:httpmail:importance") = 3.Configuration.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = 3If anyone can let me know how I can properly set the importance of the email to high, that would be great. Thanks.
  9. Wow, thanks for the info. I'll give it a try, and I'll let you know how it works for me:)
  10. It wasn't installed on the new machine until just now, but when I reran the install, I received the same result.
  11. I was able to install a DVD installation of SQL Server 2005, SP 2 on my current PC without a problem. But when I tried to do the same install on my new computer, which has the exact same OS, I ran into the following errors:Error #1IIS Feature RequirementMS IIS is either not installed or is disabled. IIS is required by some SQL Server features...Error #2Microsoft SQL Server 2005 SetupAn installation for this product Microsoft SQL Server Native Client cannot be found. Try the installation again using a valid copy of the installation package.Error #3Workstation Components, Books Online, and Development ToolsFailed to installSo because of these failures, SQL Server 2005 was unable to be installed.Both PC's have an OS of Microsoft Windows XP Pro, Version 2002, SP2. So I have no idea what could be causing this problem. If anyone could help to point me in the right direction, that would be great. Thanks.
  12. When I commented out the last two lines or the first of the last two lines, it didn't open up anything.Concerning this function possibly opening up two windows, this is the only setup I've found that can open a URL, and then resize that window within one link. If there's another easier way to do it, I'd be very happy to hear about it and use it.I appreciate your help. Thanks.
  13. That had no affect. By the way, here's the function that it uses:<!-- Begin if (window != top) top.location.href = location.href; function NewWindow(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 1.5; var wint = (screen.height - h) / 1.65; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } // End -->
  14. I have an old page that displays a popup window using JavaScript within an ASP page, like this:Response.Write("<a href='" + strCurrentQSURL + "&print=true' onclick=""NewWindow(this.href,'name','800','600','yes');return false;"" target='_blank'>Printer-friendly Version</a>")...but when I tested this link in IE7, it crashed the app all together. When I removed the reference to onclick=""NewWindow(this.href,'name','800','600','yes');return false;"", it worked fine. I want to keep the window-resize feature, so is there a way to make this javascript open window code work in IE7? Thanks for any help.
  15. I used FSO in ASP without any problems, and I'm wondering if you can use FSO in the same way in ASP.NET (2.0). This is the method that I've been using in ASP: Dim strPhotoPath = Trim(rsPhoto("DC_FileName").Value.ToString)Dim objFSO As Object = Server.CreateObject("Scripting.FileSystemObject")Dim strPhotoFilePath As String = "\\SERVER1\Photo\" & strPhotoPathDim strPhotoDestination As String = "e:\wwwroot\SERVER2\temp\"If objFSO.FileExists(strPhotoFilePath) Then 'Copy file to its destination Dim objFileCopy As Object = objFSO.GetFile(strPhotoFilePath) objFileCopy.Copy(strPhotoDestination) objFileCopy = nothingEnd If Thanks for any help.
  16. I've solved the problem by adding the following if statement around the problem code:If strTax <> 0 Then If Len(strTax) > 2 Then strTax = Left(strTax, Len(strTax) - 2) & "." & Right(strTax, 2) End If If Len(strTax) > 6 Then strTax = Left(strTax, Len(strTax) - 6) & "," & Right(strTax, 6) End IfEnd IfstrTax = FormatCurrency(strTax)The original code couldn't handle a zero value, so this solved the problem. Thanks anyway.
  17. I have a site that uses the FormatCurrency method in ASP.NET 1.1 in the following way:strTax = FormatCurrency(strTax)We just installed ASP.NET 2.0 on this server, and I now receive the following error message:Exception Details: System.FormatException: Input string was not in a correct format.Source Error:Line 323: strTax = Left(strTax, Len(strTax) - 6) & "," & Right(strTax, 6)Line 324: End IfLine 325: strTax = FormatCurrency(strTax) '<<---Problem codeLine 326: 'Format special taxLine 327: If Len(strSpec_tax) > 2 Then So if anyone can help me to change my code so that the FormatCurrency method is used in the proper way for ASP.NET 2.0, that would be great. Thanks for any help.
  18. After looking up XslTransform's documentation, I also realized that it was now obsolete in 2.0. Our current test server will start running 2.0 exclusively soon, so I'll have to change my site's master page to reflect this change.I really appreciate your help, as I know that you are busy. And when you have time, it would be very helpful if you could show me an example in 2.0 as you stated. So thanks for the offer, and all of your help.
  19. Thanks for the reply aalbetski.When I converted your code to VB.NET and tried your suggestion, I received this error message: BC30002: Type 'XslTransform' is not defined. This is the converted code that I'm using: Dim xsl As XslTransform = New XslTransformxsl.Load(MapPath("form.xsl"))Dim xsltArgs As XsltArgumentList = New XsltArgumentListxsltArgs.AddParam("fname_value", "", "Hello")Me.xmlReport.Document = GetXMLDataSourceMe.xmlReport.TransformArgumentList = xsltArgsMe.xmlReport.Transform = xsl From what you can see, is there something that I'm not doing properly?
  20. I've been able to pull and assign a XSLT parameter in ASP, but I'm now converting my site over to ASP.NET. I'm using XML, XSLT, ASP.NET, and VB.NET for this new site using the xslTransform method, and I want to pull an XSLT parameter into the ASP.NET page, and then assign a new value to that XSLT paramater using a form that's created from the XSLT stylesheet. This is what I have so far:XSLT parameter <xsl:param name="fname_value" select="''" /> ASP.NET code <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %><%@ import Namespace="System.Data" %><%@ import Namespace="System.Web" %><%@ import Namespace="System.Web.UI" %><%@ import Namespace="System.Web.UI.WebControls" %><%@ import Namespace="System.Web.UI.HtmlControls" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Xml.Xsl" %><%@ import Namespace="System.Xml.XPath" %><%@ import Namespace="System.IO" %><%@ Import Namespace="System.Text" %><script language="vb" runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim xmlURL As String = "form.xml" Dim xslURL As String = "form.xsl" 'Assign dynamic url for this page xslTransform.DocumentSource = xmlURL xslTransform.TransformSource = xslURL End Sub</script><html><body> <asp:Xml id="xslTransform" runat="server"></asp:Xml></body></html> I haven't found much on how to do this in ASP.NET, but I did find a great article from a book titled "XSLT and ASP.NET" at http://www.topxml.com/dotnet/articles/xslt...ransforming_XML under the ".NET Classes Involved in Transforming XML" section. The book/article is written in C#, and I use VB.NET. But I'm using a C# to VB.NET converter at http://www.developerfusion.co.uk/utilities...csharptovb.aspx to help out.As far as I can see, this article doesn't have any examples involving pulling and assigning a value for an XSLT parameter using the method that I'm using, so I'm not sure where to go with this. So I'm looking for some direction on this subject. I'd appreciate any help. Thanks.
  21. Wow aspnetguy. Thanks for doing that. I'll definitely bookmark that site, and I'll add an ending post once the pages are complete. I appreciate your help, and I hope that you have a great weekend.
  22. I found a great article titled "Creating Dynamic ASP.NET Server Controls Using XML" at http://www.dnzone.com/showDetail.asp?TypeI...m&offset=10.But all of the code was written in C#. I've tried using the C# to VB.NET conversion tool at http://www.kamalpatel.net/ConvertCSharp2VB.aspx, but I'm still running into errors. This is the latest error:BC30205: End of statement expected.Line 19: Line 20: Public Class WebForm1Line 21: Inherits System.Web.UI.Page Public class WebForm1 : System.Web.UI.PageLine 22: Line 23: Protected Title As System.Web.UI.WebControls.TextBoxAnd since I don't know C#, and I'm a newbie to VB.NET, I'm not sure how to proceed. If anyone can give me some help and/or some converted code, that would be great. Thanks for any help.Original C# Code: using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;// add references for XSLTusing System.Xml;using System.Xml.Xsl;using System.Xml.XPath;// add references for Streamsusing System.IO;namespace CustomSurveys{ /// <summary> /// This is a custom survey page, where the questions /// are created at runtime /// </summary> public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.TextBox Title; protected System.Web.UI.WebControls.PlaceHolder survey; protected System.Web.UI.WebControls.Literal ThankYouLabel; private void Page_Load(object sender, System.EventArgs e) { if (IsPostBack) { ProcessSurveyResults(); survey.Visible = false; ThankYouLabel.Visible = true; } else { survey.Visible = true; ThankYouLabel.Visible = false; } } private void CreateSurvey() { // Load the data source XPathDocument surveyDoc = new XPathDocument(Server.MapPath("ExSurvey.xml")); // Load the xslt to do the transformations XslTransform transform = new XslTransform(); transform.Load(Server.MapPath("MakeControls.xslt")); // Get the transformed result StringWriter sw = new StringWriter(); transform.Transform(surveyDoc, null, sw); string result = sw.ToString(); // remove the namespace attribute result = result.Replace("xmlns:asp=\"remove\"", ""); // parse the control(s) and add it to the page Control ctrl = Page.ParseControl(result); survey.Controls.Add(ctrl); } private void ProcessSurveyResults() { // Load the data source XPathDocument surveyDoc = new XPathDocument(Server.MapPath("ExSurvey.xml")); // create an iterator XPathNodeIterator itr = surveyDoc.CreateNavigator().Select("//question"); // string builder for survey body System.Text.StringBuilder sb; sb = new System.Text.StringBuilder(); // submission information sb.Append("Survey submitted on " + DateTime.Now + Environment.NewLine); // foreach question while (itr.MoveNext()) { // get the control name string controlName = itr.Current.GetAttribute("name", ""); // append question information sb.Append(controlName); sb.Append(" : "); // get the control object ctrl = FindControl(controlName); // append the correct filled out information if (ctrl is TextBox) { sb.Append(((TextBox)ctrl).Text); } if (ctrl is RadioButtonList) { // the selected item might be null if (((RadioButtonList)ctrl).SelectedItem != null) { sb.Append(((RadioButtonList)ctrl).SelectedItem.Value); } } sb.Append(Environment.NewLine); } string body = sb.ToString(); // send the results System.Web.Mail.SmtpMail.SmtpServer = "your.smtp.server"; System.Web.Mail.SmtpMail.Send("survey@somewhere.com", "your@address.com", "Survey result", body); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); CreateSurvey(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion }} Converted VB.NET Code: Imports SystemImports System.CollectionsImports System.ComponentModelImports System.DataImports System.DrawingImports System.WebImports System.Web.SessionStateImports System.Web.UIImports System.Web.UI.WebControlsImports System.Web.UI.HtmlControls' add references for XSLTImports System.XmlImports System.Xml.XslImports System.Xml.XPath ' add references for StreamsImports System.IO Public Class WebForm1 Inherits System.Web.UI.Page Public class WebForm1 : System.Web.UI.Page Protected Title As System.Web.UI.WebControls.TextBox Protected survey As System.Web.UI.WebControls.PlaceHolder Protected ThankYouLabel As System.Web.UI.WebControls.Literal '***THIS SECTION BELOW WOULD NOT CONVERT*** private void Page_Load(Object sender, System.EventArgs e) { if (IsPostBack) { ProcessSurveyResults(); survey.Visible = false; ThankYouLabel.Visible = true; } else { survey.Visible = true; ThankYouLabel.Visible = false; } } '***THIS SECTION ABOVE WOULD NOT CONVERT*** Private Sub CreateSurvey() ' Load the data source Dim surveyDoc As XPathDocument = New XPathDocument(Server.MapPath("ExSurvey.xml")) ' Load the xslt to do the transformations Dim transform As XslTransform = New XslTransform() transform.Load(Server.MapPath("MakeControls.xslt")) ' Get the transformed result Dim sw As StringWriter = New StringWriter() transform.Transform(surveyDoc, Nothing, sw) Dim result As String = sw.ToString() ' remove the namespace attribute result = result.Replace("xmlns:asp=\"remove\"", "") ' parse the control(s) and add it to the page Dim ctrl As Control = Page.ParseControl(result) survey.Controls.Add(ctrl) End Sub Private Sub ProcessSurveyResults() ' Load the data source Dim surveyDoc As XPathDocument = New XPathDocument(Server.MapPath("ExSurvey.xml")) ' create an iterator Dim itr As XPathNodeIterator = surveyDoc.CreateNavigator().Select("//question") ' string builder for survey body Dim sb As System.Text.StringBuilder sb = New System.Text.StringBuilder() ' submission information sb.Append("Survey submitted on " + DateTime.Now + Environment.NewLine) ' foreach question While itr.MoveNext() ' get the control name Dim controlName As String = itr.Current.GetAttribute("name","") ' append question information sb.Append(controlName) sb.Append(" : ") ' get the control Dim ctrl As Object = FindControl(controlName) ' append the correct filled out information If TypeOf ctrl Is TextBox Then sb.Append((CType(ctrl, TextBox)).Text) End If If TypeOf ctrl Is RadioButtonList Then ' the selected item might be null If Not(CType(ctrl,RadioButtonList)).SelectedItem Is Nothing Then sb.Append((CType(ctrl, RadioButtonList)).SelectedItem.Value) End If End If sb.Append(Environment.NewLine) End While Dim body As String = sb.ToString() ' send the results System.Web.Mail.SmtpMail.SmtpServer = "your.smtp.server" System.Web.Mail.SmtpMail.Send("survey@somewhere.com", "your@address.com", "Survey result", body) End Sub #Region 'Web Form Designer generated code Overrides Protected Sub OnInit"(ByVal e As EventArgs) ' ' CODEGEN: This call is required by the ASP.NET Web Form Designer. ' InitializeComponent() CreateSurvey() MyBase.OnInit(e) End Sub Private Sub InitializeComponent() Me.Load += New System.EventHandler(Me.Page_Load) End Sub #End Region End Class
  23. These are all of the namespaces I have referenced at the top of my page:<%@ import Namespace="System.Data" %><%@ import Namespace="System" %><%@ import Namespace="System.IO" %><%@ import Namespace="System.Xml" %><%@ import Namespace="System.Text.RegularExpressions" %><%@ import Namespace="System.Web.UI" %> ...so I should be covered, correct? But I still receive the same error message when attempting to call that method.
  24. I looked in the list of References in VWD2k5 by going to Website > Add Reference > .NET, but I did not find a file called System.Web.dll. Am I looking in the wrong place?
  25. Well, I've installed Visual Web Developer 2005 Express Edition, and I really like it so far. Thanks for the suggestion. I see how to add a reference to my site, but I don't know which reference to choose. There are two lists: .NET and COM. I've looked for "Client Script Manager" and "Register Client Script Include", but neither of them are on the lists. Could you help to point me in the right direction?
×
×
  • Create New...