Search Results

Search found 875 results on 35 pages for 'colin gray'.

Page 9/35 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • adding multiple <asp:Hyperlink>s into a repeater

    - by Colin Pickard
    I have a repeater control, and I want to put an unknown number of <asp:Hyperlink>s into the template, for example if you start with this: <asp:Repeater runat="server" ID="PetsRepeater"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Owner")%> <%#this.ListPets(Container.DataItem)%> </ItemTemplate> </asp:Repeater> and in code behind: public partial class test1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PetOwner p = new PetOwner() { Owner = "Jimmy", PetNames = new List<String>() { "Nemo", "Dory" } }; List<PetOwner> PetOwners = new List<PetOwner>() { p }; PetsRepeater.DataSource = PetOwners; PetsRepeater.DataBind(); } } protected String ListPets(Object PetOwner) { StringBuilder sb = new StringBuilder(); foreach (String Name in ((PetOwner)PetOwner).PetNames) { if (sb.Length > 0) sb.Append(", "); sb.Append(Name); } return sb.ToString(); } } class PetOwner { public String Owner; public List<String> PetNames; } Now suppose instead of having the string "Nemo, Dory" in my repeater, I want something like this: <asp:HyperLink runat=server Text="Nemo" NavigateUrl="Pet.aspx?Name=Nemo" />, <asp:HyperLink runat=server Text="Dory" NavigateUrl="Pet.aspx?Name=Dory" /> How can I do that? I tried putting a foreach inline in the aspx page, but I get the error Invalid expression term 'foreach'.

    Read the article

  • asp.net calendar control appears below textfield

    - by user279521
    I ma using an image button to display an asp.net calendar control (this control comes with VS 2008). However, when I click the image button, the calendar controls is displayed "below" the textfield that it is suppoed to populate. How can I get the control to appear on the right side of the textfield? My code is: <asp:ImageButton ID="imgCalendar" runat="server" Height="17px" ImageUrl="~/Images/CAL.gif" onclick="imgCalendar_Click1" Width="19px" Visible="true" ImageAlign="Middle" /> <asp:Panel ID="Panel1" runat="server"> <asp:Calendar ID="calStartDate" runat="server" BackColor="Transparent" BorderColor="#FFCC66" BorderWidth="1px" DayHeaderStyle-BackColor="gainsboro" DayNameFormat="Shortest" FirstDayOfWeek="Monday" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt" ForeColor="Gray" Height="102px" OnSelectionChanged="calStartDate_SelectionChanged" OtherMonthDayStyle-ForeColor="gray" SelectedDayStyle-BackColor="Navy" SelectedDayStyle-Font-Bold="True" SelectorStyle-BackColor="gainsboro" ShowGridLines="True" TitleStyle-BackColor="gray" TitleStyle-Font-Bold="True" TitleStyle-Font-Size="12px" TodayDayStyle-BackColor="gainsboro" Visible="False" Width="62px"> <SelectedDayStyle BackColor="#404040" Font-Bold="True" /> <TodayDayStyle BackColor="#3A080B" ForeColor="White" /> <SelectorStyle BackColor="#FFCC66" /> <OtherMonthDayStyle ForeColor="#CC9966" /> <NextPrevStyle Font-Size="9pt" ForeColor="#3A080B" /> <DayHeaderStyle BackColor="#3A080B" Font-Bold="True" Height="1px" ForeColor="White" /> <TitleStyle BackColor="#E0C16B" Font-Bold="True" Font-Size="9pt" ForeColor="#3A080B" /> </asp:Calendar> </asp:Panel>

    Read the article

  • How to download .txt file from a url?

    - by Colin Roe
    I produced a text file and is saved to a location in the project folder. How do I redirect them to the url that contains that text file, so they can download the text file. CreateCSVFile creates the csv file to a file path based on a datatable. Calling: string pth = ("C:\\Work\\PG\\AI Handheld Website\\AI Handheld Website\\Reports\\Files\\report.txt"); CreateCSVFile(data, pth); And the function: public void CreateCSVFile(DataTable dt, string strFilePath) { StreamWriter sw = new StreamWriter(strFilePath, false); int iColCount = dt.Columns.Count; for (int i = 0; i < iColCount; i++) { sw.Write(dt.Columns[i]); if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); // Now write all the rows. foreach (DataRow dr in dt.Rows) { for (int i = 0; i < iColCount; i++) { if (!Convert.IsDBNull(dr[i])) { sw.Write(dr[i].ToString()); } if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); } sw.Close(); Response.WriteFile(strFilePath); FileInfo fileInfo = new FileInfo(strFilePath); if (fileInfo.Exists) { //Response.Clear(); //Response.AddHeader("Content-Disposition", "attachment; filename=" + fileInfo.Name); //Response.AddHeader("Content-Length", fileInfo.Length.ToString()); //Response.ContentType = "application/octet-stream"; //Response.Flush(); //Response.TransmitFile(fileInfo.FullName); } }

    Read the article

  • How can I obtain a list of modified files within a 'changeset' range from team foundation server thr

    - by Colin W
    I'm trying to create a tool which will help my team perform code reviews on a more regular basis without it's usual massive overhead. At the moment the manual process involves using Team Foundation Sidekicks to identify the Changesets and then exporting that to excel to filter the results to find which items need to be reviewed (e.g. code files). I've heard mention of using a TFS API, but found very little help online possibly because I was asking google 'the wrong questions'.

    Read the article

  • AutoCompleteExtender positioning menu incorrectly when scrolled

    - by Colin
    We have an AutoCompleteExtender linked to a TextBox. Both controls are placed inside an UpdatePanel, and the UpdatePanel is displayed as a pop-up dialog using a Javascript library (Ext.BasicDialog). The pop-up is a div on the page, not a separate window. The problem is that when the user scrolls inside the pop-up, the AutoCompleteExtender shows its menu in the wrong place. It looks like it is taking the visible distance from the top of the popup and positioning the menu from the top of the inner html of the popup (which is not visible) We are using Version 1.0.20229.20821 of the AjaxControlToolkit, and we are targetting ASP.NET Framework vewrsion 2.0. I have tried to fix the menu by attaching the following Javascript to the OnClientShown event, but it pretty much does the same thing: function resetPosition(object, args) { var tb = object._element; // tb is the associated textbox. var offset = $('#' + tb.id).offset(); var ex = object._completionListElement; if (ex) { $('#' + ex.id).offset(offset); } }

    Read the article

  • WPF calls not working during long method processing

    - by Colin Rouse
    Hi, The following method does not apply the wpf changes (background = red) until the 2nd method (DoWork) exits: private void change() { Background = Brushes.Red; Dispatcher.BeginInvoke((Action) DoWork); } DoWork() takes several seconds to run and I don't really want to put it into a thread, as this code will be used in several places and will probably interact will the Dispatcher thread at various intervals. I've tried calling the Invalidate...() methods, but to no avail. The BeginInvoke() was added to see if the delay would allow the background change to be applied before the logic was called. Typically, the logic would be part of this method. Btw, most of the logic is performed on a different thread and shouldn't block the Dispatcher thread?! Can someone please help? Thanks

    Read the article

  • How to prevent Visual Studio setting my default font sizes in an inherited control

    - by Colin
    I have a base class for all my textboxes and I want to set the default font in that class. So I started with this: public partial class MyTextBox : TextBox { public WmlTextBox() { InitializeComponent(); //Font for the whole application can be altered in the Appearance class Font = new Appearance().TextBoxFont; } } I then stripped out all the code in the form that was setting the font of the textboxes. Of course this worked fine until I altered an item on the page. Visual Studio picked up the default font for the application (set in the Appearance class), and generated code in the designer for all TextBoxes to set it to that specific font. How can I stop visual studio from generating code from my default font? I want to allow the developers to change the property, but I want to set the default font centrally.

    Read the article

  • Building VS2008 solution using MSBuild 2010?

    - by Colin Desmond
    Is it possible to build a VS2008 solution (C# and VC++ projects) using the automated MSBuild built into TFS2010? When I niavely just run it, the build fails because the 2008 Solution file needs to be upgraded (and presumably so would the project files). Can I tell MSBuild 2010 to just build the 2008 files?

    Read the article

  • Range validation not working properly in MVC3

    - by Colin Desmond
    I am generating data validation javascript in an Asp.Net MVC 3 application with the following code [DisplayName("Latitude Degrees")] [Range(0, 90, ErrorMessage = "Latitude degrees must be between {1} and {2}")] public Int32? LatitudeDegrees { get; set; } on a view model. When it was MVC2 this worked just fine, if I entered a value outside of 0-90 in the textbox I got the validation warnings. Since I moved the application to MVC 3, whenever I put any value into the texbox, legal or illegal I get the validation error appear next to it. I have EnableClientValidation set to true and UseUnobtrusiveJavascript is off (nothing in web.config or the views to turn it on).

    Read the article

  • How can a SVN::Error callback identify the context from which it was called

    - by Colin Fine
    I've written some fairly extensive Perl modules and scripts using the Perl bindings SVN::Client etc. Since the calls to SVN::Client are all deep in a module, I have overridden the default error handling. So far I have done so by setting $SVN::Error::handler = undef as described in [1], but this makes the individual calls a bit messy because you have to remember to make each call to SVN::Client in list context and test the first value for errors. I would like to switch to using an error handler I would write; but $SVN::Error::handler is global, so I can't see any way that my callback can determine where the error came from, and what object to set an error code in. I wondered if I could use a pool for this purpose: so far I have ignored pools as irrelevant to working in Perl, but if I call a SVN::Client method with a pool I have created, will any SVN::Error object be created in the same pool? Has anybody any knowledge or experience which bears on this? [1]: http://search.cpan.org/~mschwern/Alien-SVN-1.4.6.0/src/subversion/subversion/bindings/swig/perl/native/Core.pm#svn_error_t_-_SVN::Error SVN::Core POD

    Read the article

  • Left Outer Join on Many-to-One Mapping

    - by Colin Bowern
    I have a reference to call that may or may not be there. When I add the nullable option it still doing Inner Join when I want an Outer Left Join (show the left even if the right is null). Is this possible in the NH map? References(x => x.DefaultCategory, "CATEGORY_ID") .Nullable();

    Read the article

  • Java method introspection from JRuby

    - by Colin Curtin
    Is there a way from JRuby to introspect on a Java object and find out its Java-land methods? Like what http://github.com/oggy/looksee provides, but for Java. Or like (someobject).methods - 1.methods This would be nice for just taking a look at what a Java object provides versus the APIDoc for it.

    Read the article

  • Will the Order of my Associative Array be maintained from PHP to Javascript?

    - by Colin
    In PHP I'm running a mysql_query that has an ORDER BY clause. I'm then iterating through the results to build an associative array, with the row_id as the key. Then, I'm calling json_encode on that array and outputting the result. This page is loaded with AJAX, and defined in a Javascript variable. When I iterate through that Javascript variable, will I still have the order that was returned from the mysql_query?

    Read the article

  • What's wrong with XOR encryption?

    - by Colin
    I wrote a short C++ program to do XOR encryption on a file, which I may use for some personal files (if it gets cracked it's no big deal - I'm just protecting against casual viewers). Basically, I take an ASCII password and repeatedly XOR the password with the data in the file. Now I'm curious, though: if someone wanted to crack this, how would they go about it? Would it take a long time? Does it depend on the length of the password (i.e., what's the big-O)?

    Read the article

  • Finding parents where child collection does not contain an item

    - by Colin Bowern
    I am trying to get a list of parents where the child collection does not contain an item of a specific type. The LINQ equivalent would be something like: dataset.Where(x => x.Items.FirstOrDefault(y => y.Type.Code == "ABC") == null) The object model is Parent Child (Items) Type Code If Parent is my aggregate root, how would I model this in NHibernate criteria/query? Here's my first attempt: var results = session.CreateCriteria<Parent>() .CreateCriteria("Items") .CreateCriteria("Type") .Add(Restrictions.Not(Restrictions.Eq("Code", "ABC"))) .SetResultTransformer(Transformers.DistinctRootEntity) .List<Parent>(); This doesn't seem to return the right entities - it just returns them all.

    Read the article

  • Trouble compiling some decompiled C# code

    - by Colin O'Dell
    I was decompiling an open-source project (because the source for the latest version hasn't been released yet). Using RedGate's Reflector tool, it gave me this block of code: if(somecondition == true) { ref Vector3i vectoriRef; float num17 = length - num; Vector3i end = vectori3; (vectoriRef = (Vector3i) &end)[1] = vectoriRef[1] - ((int) num17); } somecondition is a boolean. length and num are floats defined outside the code. vectori3 is also defined outside the code and is of type Vector3i. The type Vector3i is essentially this code, but with x, y, and z stored as integers. When I try to compile this decompiled code, I get the following errors: Line 2: Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line 3: ; expected Line 3: Invalid expression term 'ref' Line 6: 'Vector3i' is a 'type' but is used like a 'variable' Any thoughts on how I can fix this code so it compiles correctly and does whatever it was intended to do?

    Read the article

  • ASP.NET MVC (VB) error when publishing to test server

    - by Colin
    I have an ASP.NET MVC project that works fine on my local machine (no build errors, server errors or anything). However, when I publish the project to a test server, I get an "Object reference not set to an instance of an object" error on a For Each I have in my view. I have a function within a model that returns a DataRowCollection. I'm calling that function in my controller and passing the DataRowCollection to my View, which then iterates over the rows and displays the necessary information: In the Controller I have: Function Index() As ActionResult Dim MyModel As New Model ViewData("MyDataRowCollection") = MyModel.GetDataRowCollection() Return View() End Function And then in the View, which is throwing the error: <%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> My Page Title </asp:Content> <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <% For Each MyDataRow In ViewData("MyDataRowCollection") ' do stuff with each MyDataRow Next %> I'm pretty new to ASP.NET MVC so I'm sure there might be a better way to do what I'm doing (I'd be happy to hear if there is), but my main concern is why this works fine on my local machine but throws an error on the For Each on the test server? Please let me know if I can clarify any of the above, and thanks in advance for any information.

    Read the article

  • Problem with the way the Ajax Control Toolkit tab control sets the default submit button

    - by Colin
    We have a tab control containing some textboxes for doing a search. When you keypress inside one of the textboxes, the tab control sets the default button to be the button immediately following the tab control. This is fine because that's the search button. The problem occurs after the button is clicked and results returned. Now there is no default button, and keypress does nothing. Any suggestions?

    Read the article

  • How to get gesture IDs

    - by Colin Gough
    Is there anyway to get a list of gesture ids, from the gesture library that has been created using gesturebuilder. I want to link each gesture to an images, so some sort of an id or name is needed. I have looked at the samples and other online material avaialbe for gestures, and there is no information on this matter. Any help in this matter would be appreciated. Example: if (predictions.size() > 0) { Prediction prediction = predictions.get(0); if (prediction.score > 1.0) { if(prediction.best_score == Current_Image) { Correct(); Next_image(); } } }

    Read the article

  • PHP require/include only works once in script then fails

    - by Colin
    Hi everybody, this isn't a problem as such but it's bugging me and I would appreciate any help. It might be totally obvious but I can't see it. $root_path = $_SERVER['DOCUMENT_ROOT'] require($root_path .'template/header.php') require($root_path .'template/footer.php') The script will include one or the other but not both. It will run and include the header but not the footer, if I swap them round it will load the footer first but not the header. I've tried using include instead of require but get the same result. It gives the error allow_url_include = 0. I know turning this on will solve it but my question is why is it happening? Why will it include one file but not the other? Is there any way to get them to both run without turning allow_url_include on (I'm trying to be security conscious). I have PHP 5.3 and am running WAMP. Thanks in advance for your help!

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >