That will teach me to actually test things out. Thanks anyway, I was sure it was going to be a string.
ChrisAdams
Posts
-
VBScript Variant Question -
VBScript Variant QuestionA puzzle came up today which I can't really explain why, and was hoping someone would have a better idea than me. In VBScript if you create a string which represents a date and then call vartype on that variable, it returns as a subtype of date. I think it should be a string, and wondered why it would return as a date. dim mydate : mydate = "2005-01-01 12:20:05" response.write vartype( mydate )
-
ReaderWriterLockCould anyone help me out with a theoretical problem...... From my main thread I'm launching a child thread that each obtain a read lock from an instance of a ReaderWriterLock If the child thread does not release the read lock before it expires, will the main thread inherit that read lock, enabling it to call UpgradeToWriterLock. Sorry to be so vaugue if you need more details let me know. Thanks, Chris.
-
TypeConverter on Array PropertyHi, I'm trying to use TypeConverters on a a property which is an Array of specific objects. It works well converting to a string, but fails to convert back to the obejct. I have tried setting up my own Typeconverter but its methods are never called. Any ideas on what I need to do to get this working. Thanks, Chris
-
Newbie JavaScript HelpOnTextChanged is the server side event, where as you have written the a client side event handler. Try adding the attribute onchange="isScanned();" which should be the client side event for a text field.
-
InstanceDescriptor and Server ControlHi Guys, I'm trying to write a server control that exposes as one of it's properties an object. I've created a TypeConvertor that converts from a string representation to an instance of my object, and have also implemented the converstion from the object to an InstanceDescriptor. When I create the InstanceDescriptor, I am passing in the parameters for the default no argument constructor of my object, and the third parameter to specify that the object can not be fully created from the InstanceDescriptor - which should force the serializer to output code for the properties of my object as well.... return new InstanceDescriptor( XmlDocType.GetConstructor( System.Type.EmptyTypes ), null, false); However the code that is generated for the asp.net does not have any code for setting the propertiess of my object. I know I could just create a constructor that takes in the values, and return the relevant InstanceDescriptor, but I would like to get it working the other way first. Does anyone know if this is possible, and where I could be gonig wrong? Also I've looked at implementing my own CodeDomSerializer for my object, but cannot get the asp.net to actually call my implementation - again if any knows where I am going wrong with this, would be helpful to hear from you. Thanks. Chris.
-
How can I close the first page?You don't need to open up a new web page. Just use document.location = "NextPage.asp";
-
No correct xhtml from XML and XSLUse the inline syntax for your attribute then you can have a closed tag element.
-
Extracting the htm page from its shortcutIt's just a text file. Drop it inot notepad to see the format and you can the parse it in your own code to get the url you need.
-
Windows Service dependency problemWithin the Service Control Panel, you can set dependencies within the properties page. Window will only start your service after the dependency has started.
-
XmlNode.Value PropertyIt really depends on what you are trying to do with the xml document. A 50 MB document loaded into the DOM is quite big, but if you want to edit it then you will have to. From what I cal tell though all you really want to do is read the document and add the element's name and text value to a list. The XmlTextReader is ideal for this, as it is only reading a stream, and not creating objects in memory for each node, However this is not going to return you XmlNode's as it is not a dom implementation. Take a look at the documentation, you will need to call Read() to move along each element, then you can access the Name and Value property of the XmlTextReader to get the data you want I think.
-
write IO.Stream to a fileHmmmmm, could this perhaps be something to do with the System.IO.FileStream, and the System.IO.File classes!!
-
XmlNode.Value PropertyWhen an xml node with text is loaded up into a dom, the text is not added as part of the element, but is added as a seperate child node of type text. So something which looks like Hello in an xml file, would be represented within the dom as Element Node - Name: MyNode ---- Text Node - Value Hello. So when looping round the dom, to get the value of the MyNode element you need to access to first child and get it's value. root.firstChild.Value. Or use the most helpful Text property instead root.Text. Hope this helps....
-
Merging of two XML documentsYes it is possible, I have worked on many a project where xml files are merged. Unfortunatly I don't think there is any generic tool that will just do it for you, they way I have seen it done, is that the global xml file is loaded into the dom using MSXML, and the local file is loaded into a seperate dom. Then for each node in the local file, a select is run against the global dom, to see if that node already exists. If it does the value is either replaced if the node does not exist then it is added into the dom. All of this can be done using microsofts MSXML, just means writing some code yourself.
-
Custom button questionHave a look in the articles, someone has already posted a .Net control for creating rounded displays. If not, you can extend the button control or the basic System.Web.Control to create your own server control, basically you just add the html you need during the Render method, again there are plenty of articles here already explaining how to do this.
-
How do I display byte[ ] image on webform??You can't stream the image out within the same webform, as the browser has to make a seperate request for the image bytes after it has received the html of the web page. There are some good articles already on caching images and creating a http handler to output image data.
-
Confused about cachingIt sounds a bit excessive, but if the hosting service really want to reduce the load on their servers then they might do it. Sounds like he needs to change to a different provider.
-
How to force a file download?Or you could use as asp.net page to stream the content out. You would have to load the file into a stream, then write the bytes out to the response using Request.BinaryWrite() This way you could do extra checking etc before actually streaming the file, like ensuring the person has come from your website first etc.
-
Confused about cachingIn a dynamically generated page, there may be many calls to database etc that use up a lot of resources. If the data doesn't change that frequently, then it would be useful for the server to cache the results and return the cached content, especially where the requests are coming from different users. Hence the need for server side caching.
-
page not displaying server controls