Brilliant - that's the one I was looking for, thanks. Rog
Roger Jane
Posts
-
Really neat virtual machine -
Really neat virtual machineHi all, A year or two ago, I saw an article that linked to a really neat website that effectively ran a virtual desktop. I remember it started with a terminal style screen while it started up then turning in a complete interface to a virtual machine. It seemed really cool and I'm trying to find it again. Can anyone give me any pointers? Thanks Rog
-
I can't see my events...This must be fairly simple but I'm missing something... ASP.NET 2, C#. I have a button "Lookup...". The user clicks the button and a 'window' pops up from which they make a selection. The result is used to populate some fields and the 'window' goes away. The problem occurs because I'm not seeing any sign that a selection has been made. Notes: * The logic is server-side as it involves database lookups and the like. * The 'window' is actually an absolutely placed 'div' so it is actually part of the main page, not a separate browser window. * I really only want to create the entire 'sub-window' when I need to so that I'm not sending loads of un-necessary stuff to the browser when I don't need to. Help!!!!!! Rog
-
Making dynamic controls and catching their eventsNo, got that...
ListBox lb1 = new ListBox(); lb1.Style.Add("background-color", "InfoBackground"); lb1.Style.Add("color", "InfoText"); lb1.ID = "PickerBox"; **lb1.AutoPostBack = true;** lb1.Attributes.Add("height", "200px"); **lb1.SelectedIndexChanged += new System.EventHandler(HavePicked);** cell1.Controls.Add(lb1);
Think of anything else I'm doing that's stupid - there must be something! Rog -
How do I create dynamic content (has to be easy!)Excellent, thank you. I already have an 'Arthur' to hang things off. So, to do the dynamic bits, I can just adjust the string or use Arthur.FindControl("x") afterwards to adjust it. It's these things like not knowing about LiteralControl which are the 'things you don't know you don't know' that make forums like this so worthwhile! Thanks again. Rog
-
How do I create dynamic content (has to be easy!)I’m missing something (I’m experienced with C, C++ but not with C#, ASP.NET)... I want to dynamically create a control/random HTML. Do I have to do it with, for example,
HtmlTable table1 = new HtmlTable(); table1.Attributes.Add(“border”, “0”); table1.Attributes.Add(“align”, “center”); div1.controls.Add(table1);
etc. or can I pass ‘<table border=”0” align=”center”>...</table>’ to something and have it render it? Rog -- modified at 14:41 Friday 20th January, 2006 -
Libraries of functionsThat's sort of what I'm after - I didn't think of deriving my class from the library - seems a roundabout way of resolving the function names though. What I'm after really is a way of defining functions in the same way as you would, for example, the 'sin()' function as I'd much rather use: result = sin(pi*4); then result = rog.sin(pi*4); The library doesn't have any actual data (or if it is, it'll be static) and I don't intend to instantiate an instance of it. I still have this nagging feeling that I just haven't 'got the hang' of C# yet...! Rog
-
Making dynamic controls and catching their eventsThanks for reading some of it anyway! The problem isn't whether it generates a callback (it does), but it doesn't generate the event. Or, if it does, I'm not catching it. I'm sure there's a simple answer... Rog
-
Libraries of functionsHi All, This might stem back to 'C' days and I probably ought to change my 'mindset' and other such phrases but old habits die hard. Call me Cliché Man... When I write an applicaton, I tend to have a source file or two put aside to put all 'those little useful functions' in. You know, generic things like formatting a postal code, validating things etc. that don't fit in with a specific class anywhere. Well, using C#, I've implementing this as follows: In library.cs:
namespace mylib { public class rog { static public int DoSomething(int arg) { return arg+1; } } }
To call this function, I'm putting this in app1.cs:using mylib; ... b = rog.DoSomething(3);
This seems like using a class where there is really no need. I'd like to just call 'DoSomething(3)' without the 'rog.' part. I'm new to C# so be gentle, I'm old to C and C++ so feel free to be harsh. Am I being stupid? Thanks for any confirmation or denial... Rog -
Making dynamic controls and catching their eventsHi All, Any help would be cool - there are 3 questions in here, an answer to any one would be great! I'm new at this (ASP.NET and C#) and I feel that I'm making a meal out of something more simple. Perhaps one of you fellow could give me a pointer or two... I have loads of experience with C++ and so forth so there's no need to be too gentle. I need to pop up a general 'Picker' for the user to pick one from a number of options. I didn't want to use a new browser window as I have no control over it so I'm using an absolutely positioned 'DIV'. I'm adding this to a placeholder on the page when I need it using code like:
HtmlGenericControl div1 = new HtmlGenericControl(); div1.ID = "Picker"; div1.Attributes.Add("class", "box"); div1.Style.Add("left", "700px"); ... ListBox lb1 = new ListBox(); lb1.ID = "PickerBox"; lb1.AutoPostBack = true; * lb1.SelectedIndexChanged += new System.EventHandler(HavePicked); div1.Controls.Add(lb1); ... myPlaceHolder.Controls.Add(div1);
So that I can catch the effect of the user picking one of these elements, I have the line above that is marked with a '*'. (The code has other controls in the structure (there's a table below the 'div' and above the 'listbox' for example) but this is just illustrative. Now for the questions/problem: 1. "HavePicked()" is never called. The picker appears on the screen lovely and when I click on an option it disappears too. However, my code doesn't seem to notice. A breakpoint in 'HavePicked()' never gets seen. 2. It's very laborious adding in each element and attribute 'by hand' as I've done above. I feel there must be a way that I can do something like:pickerCode = @"<div ID=""picker"" class=""box"" style=""left:700px;top:150px""><asp:ListBox ... </div>";
and using that. I haven't spotted it though. 3. SelectedIndexChanged is not really what I want. I'd like 'UserHasPickedSomething' because even in static, non-dynamically generated ListBoxes I only seem to get a postback when they chose a different option. I'd like to know if they hit return on the currently selected option or double clicked it. So, if anyone can give me some hints here then I'd be very grateful! Thanks Rog -- modified at 8:50 Thursday 19th January, 2006 -
"Messages posted" never increments...Aah... I see... I post both from home and from work so I alter my email address to my work one when I post from here (Yes, sadly I'm working on a Sunday). Ok, it follows now. Can I have two email addresses, or am I stuck with having a grey head? I suppose I could keep editing the email address in my profile before I post but that seems a bit daft! Rog
-
"Messages posted" never increments...Hey, look! The 'head' against this message is coloured in! Take a look at the (CxImage article and you'll see some shaded out ones... :(( Rog
-
"Messages posted" never increments...Why is it that the number of messages posted never goes up even though I post things on articles. The site obviously knows who I am because it adds my name etc. in when I do the post but the little 'head' image is shaded out. Did I miss something somewhere? Rog
-
Bookmarks in CPI looked there. Really I did. I wasn't there. Just like the 'K' key wasn't there when I had a user call once complaining that it was missing from their keyboard and I explained it was between the 'J' and the 'L' and they went away quietly... Thanks! Rog
-
Bookmarks in CPI may be being dense, but I can't see how to bookmark an article... Can someone enlighten me (I guess this equates to reducing my density...:-D!) Rog