Jump to content

kwilliams

Members
  • Content Count

    229
  • Joined

  • Last visited

Everything posted by kwilliams

  1. 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>
  2. 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>
  3. kwilliams

    ASP CDOSYS Problem

    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.
  4. Wow, thanks for the info. I'll give it a try, and I'll let you know how it works for me:)
  5. It wasn't installed on the new machine until just now, but when I reran the install, I received the same result.
  6. 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.
  7. 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.
  8. 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 -->
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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?
  15. 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.
  16. 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.
  17. 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
  18. 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.
  19. 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?
  20. 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?
  21. Ok, thanks for the info. I think that you can tell that I'm a newbie to all of this.I was able to find another publishing of the article that actually does contain the downloadable code at http://www.dnzone.com/ShowDetail.asp?NewsId=151. I use VB.NET, so I'll have to convert all of the C# code, but I think that it will point me in the right direction. Thanks again.
  22. I'm following a great article titled "Creating Dynamic ASP.NET Server Controls Using XML" at http://www.devarticles.com/c/a/ASP.NET/Cre...ls-Using-XML/2/, but I'm running into strange problems when I attempt to re-produce the pages.Basically, the ASP.NET server controls show up in the code, but they aren't being displayed on the page. The method I'm using involves XML/XSLT transformation on an ASP.NET page, but I've also tried just attaching the XSLT stylesheet to the XML doc to no avail. So I've included the code that I'm using at the bottom of this post. If anyone can help me to figure out what I'm doing wrong, I'd appreciate it. Thanks.XML DOC: <?xml version="1.0" encoding="UTF-8"?><test> <survey name="Example Survey"> <question type="text" name="Title" required="yes"/> <question type="text" name="Industry"/> <question type="radio" name="Education"> <choice>High school</choice> <choice>Some college</choice> <choice>College</choice> </question> </survey> </test> XSLT DOC: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asp="remove"><xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"/><xsl:template match="/"> <div id="content"> <table> <xsl:for-each select="//question"> <tr> <td valign="top"><xsl:value-of select="@name" /> <xsl:if test="@required = 'yes'"> <asp:RequiredFieldValidator ErrorMessage="RequiredField" runat="server" ControlToValidate="{@name}" /> </xsl:if> </td> <td> <xsl:if test="@type='text'"> <asp:TextBox id="{@name}" runat="server" /> </xsl:if> <xsl:if test="@type='radio'"> <asp:RadioButtonList id="{@name}" runat="server"> <xsl:for-each select="choice"> <asp:ListItem Value="{@value}"><xsl:value-of select="@value"/></asp:ListItem> </xsl:for-each> </asp:RadioButtonList> </xsl:if> </td> </tr> </xsl:for-each> </table> <asp:button id="submit" runat="server" Text="Submit" /> </div></xsl:template></xsl:stylesheet> CODE OUTPUT: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head></head><body> <form name="_ctl1" method="post" action="index.aspx?page=test" id="_ctl1"> <input type="hidden" name="__VIEWSTATE" value="dDw5OTQ1Mjc4NDc7dDw7bDxpPDE+O2k8Mz47PjtsPHQ8O2w8aTwxPjtpPDM+O2k8Nz47aTw5PjtpPDExPjs+O2w8dDxwPGw8aW5uZXJodG1sOz47bDxEb3VnbGFzIENvdW50eSwgS2Fuc2FzIC0gRmVlZGJhY2sgRm9ybSBURVNUOz4+Ozs+O3Q8cDxsPGhyZWY7PjtsPC9uZXdzaXRlL2RvY3MvY3NzL2dlY2tvLmNzczs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxcZTs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxcZTs+Pjs7Pjt0PHA8bDxjb250ZW50Oz47bDxGcmlkYXksIE9jdG9iZXIgMDYsIDIwMDY7Pj47Oz47Pj47dDw7bDxpPDE+Oz47bDx0PHA8cDxsPFRleHQ7PjtsPEZyaWRheSwgT2N0b2JlciAwNiwgMjAwNjs+Pjs+Ozs+Oz4+Oz4+Oz7sPS4LQzwPyQo7LC8Hr0V7L8jzTw==" /> <!--Dynamic page content from XSLT doc--> <?xml version="1.0" encoding="iso-8859-1"?> <div id="content" xmlns:asp="remove"> <table> <tr> <td valign="top">Title<asp:RequiredFieldValidator ErrorMessage="RequiredField" runat="server" ControlToValidate="Title" /></td> <td> <asp:TextBox id="Title" runat="server" /> </td> </tr> <tr> <td valign="top">Industry</td> <td> <asp:TextBox id="Industry" runat="server" /> </td> </tr> <tr> <td valign="top">Education</td> <td> <asp:RadioButtonList id="Education" runat="server"> <asp:ListItem Value=""></asp:ListItem> <asp:ListItem Value=""></asp:ListItem> <asp:ListItem Value=""></asp:ListItem> </asp:RadioButtonList> </td> </tr> </table> <asp:button id="submit" runat="server" Text="Submit" /> </div><!-- end content --> </form></body></html> DISPLAY OUTPUT (just text shows up):TitleIndustryEducation
  23. I wanted to note that I've created several threads in which I did select to receive email notifications ("Enable email notification of replies?"), but I haven't received any. I have to manually go to each post to see if there was a reply. Is there something that I'm missing, or is there a problem with the system? Thanks for any input.
  24. I've been thinking of switching to VSE for a bit, so I appreciate your advice. I'll let you know how it goes. Thanks again.
  25. Hi aspnetguy,Sorry that I didn't get back to your question sooner. This forum isn't emailing me even thought I've subscribed to the thread. I'm developing the site using Web Matrix, and I'm not sure how I would add a reference with that...or whether or not I need to. If you could give me more clarification on this, that would be great. Thanks.
×
×
  • Create New...