What are the speed differences (if any) between using Textboxes,Radiolists, Labels etc to build a form as opposed to using a variety of custom controls to build the same form? (One of the custom controls would be, for instance, a label and textbox).
methodincharge
Posts
-
Speed differences using all custom controls to build a form? -
Common ProblemI know I've seen the solution for this before, but for some reason I cannot think of the appropriate words to use as a search query. Basically I have a User Control on a page that contains 10 radio buttons the user uses to select a number 1-10. The problem is, of course, that upon the first submit the values are not retained in the radio buttons, but upon the second submission they are. I only wish I still had the project in which I solved this problem originally. Thanks.
-
Eliminating HTML from an end-result ASPX page, just text?Don't know quite how to word this question, thus I have not search for it, but is there a way to eliminate all the HTML from the code of an ASPX page? Meaning, if I did Response.Write("blah") and did View Code, all I would see would be blah? The reason I ask is that I need to call an aspx page from Flash and get the data returned, but it must be in the form blah=what&count=1 etc... Unless there is a better way. Any suggestions?
-
Extracting text from HTMLAnyone know of a good method for extracting the text from an HTML document (loaded from an address). I would also be interested in knowing the size of the text as well. Any thoughts?
-
Word to xml using C#?I have found the need to convert a word document (its text, tables and images) to an XML file that could give a general layout like the world file. Firstly is there an easier way to do this other than programatic access to the Word object model? Secondly, if I do have to programatically accomplish this, I need to assign names to to the tables, images and text. Currently I'm trying either a caption or a bookmark, but there may be an easier way. By the way I'm using Word 2000 if that is of importance, and I am also using C#. Thanks.
-
How to close a form in its Load event handlerThere could be two approaches that I can think of that may be of use. The first would involve creating a Timer event, and if the data fails, start the Timer and allow the Load event to close and maybe a second or something liket that before firing it to close the Form. The second is to use a ShowDialog() error box inside the load before the form itself gets loaded, and upon the error window exiting, close the form. I have done the second, however using Application.Exit() so it may not work for simply closing the form. I would say the timer is the best approach. Also do you just have one form that you want to close or is a child form (havent read through the posts) because if I do this.Close() in the main or child in the Load it does close it. Maybe you have to Garbage Collect or cleanup the variables?
-
XmlException when uploading Image to databaseHow would I go about doing that if I am using SOAP to transport the data to and from the web service? Also I read that CDATA only makes the problem less likely (IE: if the string is terminated by ])> it will cause the section to end) and I figure that if I'm going to be using this just for images the liklihood of that would be pretty high. Any suggestions? I tried using Base64 encoding, but that gives the same error.
-
XmlException when uploading Image to databaseI have a web service that will upload/retrieve images from a MySQL database. I am passing it an array of objects to signify multiple images (although I am only using one). Anyway when I get the binary array and try to execute oCmd.ExecuteNonQuery(); I get the following error:
', hexadecimal value 0x10, is an invalid character. Line 1, position 449.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Xml.XmlException: '', hexadecimal value 0x10, is an invalid character. Line 1, position 449.
The code I use is as following:
OdbcCommand oCmd = null; foreach(String name in names) { byte[] singleton = data[names.IndexOf(name)] as byte[]; oCmd = new OdbcCommand("INSERT INTO images (name,data,length,user) VALUES (?name,?data,?size,?user)",oCon); OdbcParameter p0 = new OdbcParameter("?name",OdbcType.VarChar,100); p0.Value = name; oCmd.Parameters.Add(p0); OdbcParameter p1 = new OdbcParameter("?data",OdbcType.Binary); p1.Value = singleton; OdbcParameter p2 = new OdbcParameter("?size",OdbcType.Int,20); p2.Value = singleton.Length; oCmd.Parameters.Add(p2); OdbcParameter p3 = new OdbcParameter("?user",OdbcType.VarChar,100); p3.Value = username; oCmd.Parameters.Add(p3); oCmd.ExecuteNonQuery(); }
I am thinking maybe it's an issue with Encoding? Unfortunately I was never good at dealing with Encoding. Can anyone help? -
WebService SoapInclude, custom classes?Yeah so I created a nice little Web Service that returned a custom class called Site which has 3 strings and an int. I kept getting:
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type PortalService.Site was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType)And I used both XmlInclude and SoapInclude to no avail. So I said screw it and created a string with a delimiter that I could parse when it returned to the client. Perfect. Except now when I call the WebService, the webpage's graphics don't load completely and at random. I suppose this perhaps attributed to the fact that I just did <% Function() %> since the basic Repeater did not suite my needs. Any suggestions?
-
Elegant Client/Server?Well I am basically working on a simplistic messaging program, which I have completed with success, however I need to have file transfer abilities. So far, all of my attempts have failed due to interleaving of messages of which I cannot seem to prevent. It would seem that there might be a better way of transferring data using XML and perhaps serialization that would alleviate the problems of having to custom build and parse my own messages. The whole idea of the web service is pretty much exactly what I am looking for, except the fact that it only response to clients per request. If there was a way to create a server using the same technology I would definitely like to attempt to do so.
-
Elegant Client/Server?Yeah, the premise of the Web Service is exactly what I need, but I haven't been able to figure out if I can use the Web Service to keep track of clients?
-
Elegant Client/Server?I have been working on a client/server application model for a long time and am having a terrible time dealing with file transfer. The main problem is basically having to build and parse the messages myself. I have been looking through a lot of Remoting and other forms of client/server interaction and it seems like some of the ideas here would provide a much more efficient and elegant solution to a client/server program. What I have been kind of wandering is if there is a simple way to serialize data then send it to the server who in turn just channels it to the appropriate client after doing some basic extraction/parsing. From what I've seen if I could utilize XML and SOAP then the task shouldn't be too difficult, but as I am waiting for some books to arrive on the subjects, I am eager to get started. Can anyone lead me in the correct direction if I wanted to do the following: Serialize messages into XML format to send to the server Server receives the XML message, parses it, then sends it along to the approporiate client It seems intuitive that if, instead of streaming binary data to send files manually (which is how I am currently having to approach it) I could just serialize a byte array, or in the case of images, serialize a PictureBox, this whole mess could be cleaned up simply. Any assistance would be appreciated.
-
Custom Repeater or something else?I just realize it too out the spacing I put in, so it may be a bit deceiving. What I am getting is 8 items from a DB with a Category attribute. So say the result would be something like: Name1 | Category1 Name2 | Category1 Name3 | Category2 Name4 | Category3 Name5 | Category3 And so on. Can I still do this with the repeater?
-
Custom Repeater or something else?Relatively new to Web Apps (I've used them before, but was just reusing code, not creating). What I need is to display data read from a database in the following manner: Header Header2 Header3 Item1 Item4 Item7 Item2 Item5 Item8 Item3 Item6 So basically 8 items will be read from a database, and it will group the items based on the common Header property. When it has displayed 3 I want it to go to the next line. Any advice?
-
Custom Control FocusIs there an easy way to prevent a child Control from getting the focus? Meaning if I have a component, then I add a label, but I am testing the MouseEnter/MouseLeave event on the parent, it will fire when the mouse goes over the Label.
-
how to intercet ondraw event?Off the top of my head, if you derive your own class from a TextBox component, you could override the OnPaint method and not call base.OnPaint. Haven't done it before though, so it may be wrong, but I believe that is what you are looking for.
-
Show hidden formsThanks for the code. It all works ALMOST the exact way I wanted it to. For some reason if I tried to save the last active window (IE on return to the app, either make the main window the active one or the message window the active one depending on which was activated last) it would go back and forth between the two and then settle on the main window. So instead I just brought the messagewindow in front upon returning to the app (although I might change it around). Thanks again for the Time suggestion, I doubt I would have thought of it.
-
Show hidden formsHaha, for some reason when you said "static variable" I didn't put 2 and 2 together and was looking for an instance variable, which is why I couldn't find it. Thanks for the reply, I'll go about implmenting it today and I'll let you know it turns out.
-
Show hidden formsCould you elaborate on the ActiveForm static member? Should this be in A or B, and how/where should it be set/unset? Or are you referring to ActiveControl? Thanks.
-
Show hidden formsRob Tomson wrote: can't you just use ShowDialog? I need to have access to A while B is open, otherwise I would.