Jump to content

BryanHood

Members
  • Posts

    21
  • Joined

  • Last visited

BryanHood's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. <xsl:for-each select="Item[ItemType='BOOK']"> <xsl:if test="position()=1"> <First_Book_Title> <xsl:value-of select="Description"/> </First_Book_Title> </xsl:if></xsl:for-each> The trick was to search for all <Item> nodes that contain the ItemType of "BOOK". select="Item[itemType]='BOOK'] This will give you a list of Item nodes. From the returned list, we only want the first item, so we need to use the position() function. And there you have it! Simple and neat. (Although it did take a while to figure out )
  2. L8V2L, At my work we use XML and XSLT translations to deliver information to various 3rd party software packages. We create our own "generic" data dumps, and then use XSLT to transform it into whatever is needed for them.
  3. I have the following list: <Item> <ItemType>TOOL</ItemType> <Description>Hammer</Description></Item><Item> <ItemType>BOOK</ItemType> <Description>Programming in XSLT</Description></Item><Item> <ItemType>UTENSIL</ItemType> <Description>Fork</Description></Item><Item> <ItemType>BOOK</ItemType> <Description>Useful Internet Sites</Description></Item> In the list I have <ItemType>'s of TOOL, BOOK, and UTENSIL. I want to loop through all of the items to find the first one that meets my criteria (in my case BOOK), and output that one only. This code outputs all items that meet the criteria of ItemType's of BOOK. <xsl:for-each select="ItemType"> <xsl:if test="ItemType = 'BOOK'"> <First_Book_Title> <xsl:value-of select="Description"/> </First_Book_Title> </xsl:if></xsl:for-each> I'd get this list: <First_Book_Title>Programming in XSLT</First_Book_Title><First_Book_Title>Useful Internet Sites</First_Book_Title> I only want to get the book titled "Programming in XSLT". Thank you.
  4. That was it!Thanks ASPNetGuy! (Or would that make you SQLandASPNetGuy?)
  5. I would like to pass into a SP a string containing a list of items, and then use that list in a Where clause.Example:exec sp_FindFromList '1, 2, 3, 4, 5' Create Proc dbo.FindFromList @paramList as VarChar(100)ASSelect *From myTableWhere column1 IN (@paramList)GO I would like to parse out the list into individual items.Thank you,Bryan
  6. Aaaarrrgggg! Is there a way around this?My code is just making sure that it's window is big enough to show a grid in it.Can I change the size of my "Current" window without trying to hit the parent frame set?
  7. Yes. The Root site is on a different web server inside our Intranet.
  8. The following code snippet is in one of my JavaScripts: function ResizeMe(idGrid, ExtraWidth, ExtraHeight) { if(window.frameElement != null) { if(window.frameElement.tagName == "IFRAME") { If I run the above code without any kind of Frames, it works fine. However, when the page loads inside a frame, I get an "Access is Denied" error whenever I try to reference the window.frameElement object.I am only developing this for IE, so I don't have to worry about Mozilla or Opera.Help!Thanks, Bryan
  9. I am using C# 3.0, and ASP.Net 2.0I have a GridView control, and I want to control the placement of the Edit/Update/Cancel buttons.I have set the AutoEventWireup property to false for the page.I then set the AutoGenerateEditButton property to false for my grid, and add a template column as this: <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Edit" Text="Edit"></asp:LinkButton> </ItemTemplate> <EditItemTemplate> <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Update" Text="Update"></asp:LinkButton> <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton> </EditItemTemplate> </asp:TemplateField> I then add my event Handlers in the OnInit function in the code behind: override protected void OnInit(EventArgs e) { this.DataBinding += new System.EventHandler(this.Detail_DataBinding); this.dtlGrid.RowEditing += new GridViewEditEventHandler(dtlGrid_RowEditing); this.dtlGrid.RowCancelingEdit += new GridViewCancelEditEventHandler(dtlGrid_RowCancelingEdit); this.dtlGrid.RowUpdating += new GridViewUpdateEventHandler(dtlGrid_RowUpdating); this.dtlGrid.RowUpdated += new GridViewUpdatedEventHandler(dtlGrid_RowUpdated); base.OnInit(e); } When I click the Edit button, I do throw the RowEditing event, but the Cancel/Update events don't happen.I have also tried the same setup with the page property AutoEventWireup set to True.Does anybody have an idea why my events are not firing?Thank you, Bryan
  10. Has anyone used the new GridView and DetailsView controls from .Net 2.0?Are there any sites out there with info on them?-Bryan
  11. Subject: DataGrid - Enable/Disable RadioButtonListI am trying to add a RadioButtonList to my datagrid. I am using C#, and VS2005 (C# 3.0, ASP.NET 2.0)I am new to DataGrids. If you can also point me to some websites that haveinfo on the DataGrids, I would be most grateful. (I have some of thebasics down, I would like to see some more advanced features/work-arounds,etc..)I have several issues that I need to address:1) Is there a way to have the list disabled when the page loads, and thenenable it when the Edit button is clicked? I would also like to disablethe list after the Update/Cancel event fires.In the ASPX page, I set the Enabled property of the list to false. I havethe following code in my C# code behind: protected void dtlGrid_EditCommand (object source, DataGridCommandEventArgs e) { this.dtlGrid.EditItemIndex = e.Item.ItemIndex; RadioButtonList rblApproveDeny = (RadioButtonList) this.dtlGrid.Items[e.Item.ItemIndex]. FindControl("rblApproveDeny"); rblApproveDeny.Enabled = true; dtlGrid.DataBind(); }void dtlGrid_CancelCommand (object source, DataGridCommandEventArgs e) { this.dtlGrid.EditItemIndex = e.Item.ItemIndex; RadioButtonList rblApproveDeny = (RadioButtonList) this.dtlGrid.Items[e.Item.ItemIndex]. FindControl("rblApproveDeny"); this.dtlGrid.EditItemIndex = -1; dtlGrid.DataBind(); } I believe that the Control's Enable feature is what is controlling thevalue of the control. Should I write a JavaScript to change the value, oris there some other place in Code that I can change it?2) (Also related to my RadioButtonList) This is how I have the control in my ASCX file set up: <asp:TemplateColumn HeaderText="Approve/Deny"> <itemtemplate> <asp:RadioButtonList ID="rblApproveDeny" runat="server" RepeatDirection="Horizontal" SelectedIndex= '<%# (int.Parse(DataBinder.Eval (Container.DataItem, "Detail_Status_Code").ToString()) - 1) %>' RepeatLayout="Flow" CssClass="tblData" Enabled="true"> <asp:ListItem Value="1" Text="Pending"></asp:ListItem> <asp:ListItem Value="2" Text="Approve"></asp:ListItem> <asp:ListItem Value="3" Text="Deny"></asp:ListItem> </asp:RadioButtonList> </itemtemplate> <headerstyle horizontalalign="Center" /> <itemstyle horizontalalign="Center" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="False" /></asp:TemplateColumn> If you notice, I am binding the RadioButtonList with the SelectedIndexproperty. The actual values that the Detail_Status_Code field has are 1,2, and 3. I am unable to directly select my ListItem based on the values.I have to change the field to an "index" value to select the ListItem.Is there a way to have the RadioButtonList search the ListItemsand "select" them where the database field = ListItem.Value?3) (Also related to my RadioButtonList. Sorry.) The value that my RadioButtonList points to is a Status Code. Thestatus' map out to 1 = "Pending", 2 = "Approve", and 3 = "Deny" After looking at problems 1 & 2, is there a way to have the "view" ofthe datagrid display the actual word Pending/Approve/Deny instead of myRadioButtonList, and upon Edit, allow the user to select one of thosevalues? (Would a drop-down list be better here instead of theRadioButtonList?)4) (Not related to the RadioButtonList. YAY!!) Is there a way to exclude some fields from being edited? I don'treally want all of them changed. Just a few.5) (Last one, I promise!) Along the lines of questions 3 & 4, is there a way to display one kindof control while the grid is in "View" mode, and then show a totalydifferent control in "Edit" mode?Thank you for all of your help. -Bryan Clauss
  12. Here is a page that is 2 levels deep. If I have a page that is only 1 level deep, it will work fine.The images in the Master have their source set to src="../images/Logo_Trans_white.gif". I tried to use "~/Images/...", but it would not work at all.I haven't tried to add code to the below page, but I am willing to bet that my CSS sheets won't pull.Thanks again!"Root" / Tools / Discrepancies / DiscrepAdd.aspx <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="DiscrepApprove.aspx.cs" Inherits="Tools_Discrepancies_DiscrepApprove" Title="Untitled Page" %><%@ MasterType VirtualPath="~/MasterPage.master" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"></asp:Content> "Root" / MasterPage.master <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %><%@ Register Src="~/SharedControls/UserInfo.ascx" TagName="UserInfo" TagPrefix="uc1" %><%@ Register Src="~/SharedControls/Menu.ascx" TagName="MyMenu" TagPrefix="ucMenu" %><!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>Untitled Page</title> --> <link href="~/Styles/styles.css" media="screen" rel="stylesheet" type="text/css"> <link href="~/Styles/stylesPrint.css" media="print" rel="stylesheet" type="text/css"></head><body style="margin: 0px; "> <form id="frmMaster" runat="server"> <div id="Header" style="z-index: 115; position: absolute; float:left; top: 0px; left: 0px; background-color: #999999; width: 100%; height: 95px;"> <img src="../images/Logo_Trans_white.gif" style="z-index: 106; left: 0px; position: absolute; top: 0px;" /> <div style="z-index: 108; background-image: url('../Images/bevel.gif'); width: 100%; height: 5px; left: 0px; position: absolute; overflow: hidden; top: 68px"> </div> <div style="z-index: 105; background-image: url('../Images/PurpleSpong.jpg'); height: 6px; width: 100%; left: 0px; position: absolute; overflow: hidden; top: 71px"> </div> <div style="z-index: 105; position: absolute; top: 77px; left: 0px; background-color: #E5E5E5; width: 100%; height: 15px;"> </div> </div> <div id="Content" style="z-index: 105; "> <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server" /> </div> <div id="Footer" class="FooterText" style="z-index: 105; "> <div style="z-index: 105; background-image: url('../Images/PurpleSpong.jpg'); height: 6px; width: 100%; left: 0px; position: relative; overflow: hidden; top: 0px"> </div> <div style="z-index: 108; background-image: url('../Images/bevel.gif'); width: 100%; height: 5px; left: 0px; position: relative; overflow: hidden;"> </div> <div style="z-index: 105; position: relative; left: 0px; background-color: #999999; width: 100%; height: 35px;"> <div class="FooterText" style="top: 0px; position: absolute; width: 100%;"> <table height="35px" width="100%"> <tr> <td width="50%" align="left" style="vertical-align: bottom;"> Ver: <asp:Label ID="PageName" runat="server" Text="MasterPage"></asp:Label> </td> <td align="right" style="vertical-align: bottom;" width="50%"> Updated: <asp:Label ID="LastMod" runat="server" Text="today"></asp:Label> </td> </tr> </table> </div> </div> </div> </form></body></html>
  13. I am not sure if I should be asking this question here, or in the ASP forum, but here goes (I am using ASP.NET 2.0 / C# from Visual Studio 2005):I seem to be having problems calling pages/images/etc... by starting at the "Root" level of my web page.I have nested folders, and I seem to be having problems accessing things in other folders.Example (folder structure) Root|+--Images|+--Tools | +--Tools Folder 1 | +--Tools Folder 2 My "Root" has a Master Page that I call. This in turn calls an Image from the /Images folder.I have no problems calling pages, and using the Master if I am in the Tools Folder. I access those pages as "~/Images/<image>.gif"When I use my Master Page from a page located in "~/Tools/Tools Folder 1/<page>.aspx, I get the "Broken Image" icon.Is there a way for me to declare a "Base" reference, and base all of my calls off of that?Thank You, Bryan Clauss
  14. This will probably start a large debate, but here goes:When creating a web site that will (potentially) have MANY users hitting it, what would the most efficient way to connect to the database? (In my mind, MANY will be about 200-400 users during the "busy" time.)I have always created 1 connection for the user, and keep that connection open for the entire session in any of the applications that I have worked on.Other people claim that it is better for each page to open the connection, use it, and then close it when they are done.Is there a way to create 1 connection object that all users can use? Would this be efficient?I will be writing this in C# (.Net 2005), and I will be hitting a MS SQL database.As an aside, should I check for unused connections within the web app itself, and attempt to close them, or will IIS and SQL Server clean up for me?Thanks, Bryan Clauss
  15. Are you trying to use this in a class or just in a regualr form?I am creating a class that I would like to call/instantiate from within a form.If it is in a class you will need to use HttpContext.Current.Response.Write or you can make a HttpContex variable to be reused with in the class HttpContext c = HttpContext.Current;c.Response.Write(); Question: What NameSpace will I need for the HttpContext object?That may work for me. I did get the class to compile by inheriting from System.Web.UI.Page (see below), but I really did not want to do this.public class Utilities : System.Web.UI.Page
×
×
  • Create New...