113 Posted Topics
Re: [CODE]if(filename.EndsWith(".pdf")) { //open pdf } else if(filename.EndsWith(".jpeg")) { // open jpeg } else { //Open as text }[/CODE] | |
Re: [QUOTE=Renukavani;1171374]U need to add space in pattern and modified code is, [CODE] Match matchMyRegex = Regex.Match(fullNameTextBox.Text, "^[a-zA-z ]*$"); [/CODE][/QUOTE] Another cool way to do this is prevent them from typing any other character than letters and space (Do not forget to add your KeyPressEventHandler on your textbox) [code] protected void … | |
I've been working on something with alot of iteration (foreach) and now that everything is working I'd like to optimize it by changing it to link. Currently I am trying to translate this foreach code to LINQ [CODE] int count = 0; foreach( string file in Directory.GetFiles( path )) { … | |
Re: [QUOTE=ddanbe;1160995]Hi andrew2325, welcome here at daniweb! I should try to use a list of struct instead of string, like this: [CODE=c#] struct GradeStruct { string name; int one; int two; int three; } List<GradeStruct> MyGrades = new List<GradeStruct>();[/CODE] Read a line of your file and split it into 4 strings … | |
Re: [QUOTE=csckid;1161765]hello, I tried to change the value of a textbox from another window form. the value is passed to another form properly, but I couldn't change the value in the textbox. here is the code Form1.cs public void setTextbox(String sd) { MessageBox.Show(sd); msg.Text = "fd"; } additem.cs private void button1_Click(object … | |
Re: Did you try with the visibility style? visibility: hidden; visibility: visible; | |
Re: Did you try [code]this.Modal = true;[/code] in your mainform's designer? And then just open it with a .show(); | |
Re: [QUOTE=gangsta1903;1161991]Hello, I am trying to write a simple javascript to read all forms. My ReadForm function works right. I tried it out of ReadAllForms function, there is no problem with it. I think document.getElementsByTagName returns false. Why can this happen? [CODE=javascript] function ReadAllForms() { if (document.getElementsByTagName) var myforms = document.getElementsByTagName("form"); … | |
Is it possible to somehow compare a value to a range of value without using for/foreach. [CODE]IEnumerable<XElement> results = xdoc.Descendants( "PAGE" ).Where( p => p.Attribute( "id" ).Value == RANGE_OF_ID).Select(result => result);[/CODE] Is there anyway of doing what I wrote below? RANGE_OF_ID could be a collection. | |
Re: [QUOTE=jasystweb;1146511]I am creating controls which are added to the page at run time. As these controls are added I separate them into a UL/LI list by injecting literals assigned as (<ul>, </ul>,<li>,</li>). The page in question uses a master page template. The ul/li function is called in the page_load event … | |
I'm currently working on some ajax polling stuff and I don't want do pass through all the process if nothing has changed in the xml file I'm using for my asynchronous process. However after each polling I want to set the value DateTime.Now, but cannot do it with [CODE]Request.Form[ "lastPoll" … | |
Re: [QUOTE=whiteyoh;1142744]Hi all, I have form validation working well. The following is how i currently validate emails. My question is how can i amend to validate it as an email? [code] if(""==document.forms.fa.user_email.value) { alert("Please enter an email address."); return false; } [/code] I have found this following script but my javascript … | |
I've been reading and trying to figure out a way for half a day yesterday, and any solutions seems to fit to this. [B] Overview:[/B] My solution is building up xml files from different folders on another server. After the xml is built up, I can run a "File Mapping" … |
The End.