113 Posted Topics

Member Avatar for Rohith Reddy

[CODE]if(filename.EndsWith(".pdf")) { //open pdf } else if(filename.EndsWith(".jpeg")) { // open jpeg } else { //Open as text }[/CODE]

Member Avatar for Geekitygeek
0
101
Member Avatar for Dimansu

[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 …

Member Avatar for Geekitygeek
0
109
Member Avatar for PierlucSS

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 )) { …

Member Avatar for PierlucSS
0
145
Member Avatar for andrew2325

[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 …

Member Avatar for Geekitygeek
0
167
Member Avatar for csckid

[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 …

Member Avatar for Geekitygeek
0
151
Member Avatar for cloud09
Member Avatar for cloud09
0
133
Member Avatar for elmbrook

Did you try [code]this.Modal = true;[/code] in your mainform's designer? And then just open it with a .show();

Member Avatar for elmbrook
0
2K
Member Avatar for gangsta1903

[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"); …

Member Avatar for PierlucSS
0
203
Member Avatar for PierlucSS

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.

Member Avatar for PierlucSS
1
142
Member Avatar for jasystweb

[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 …

Member Avatar for jasystweb
0
254
Member Avatar for PierlucSS

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" …

Member Avatar for PierlucSS
0
7K
Member Avatar for whiteyoh

[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 …

Member Avatar for rajendra.parmar
0
122
Member Avatar for PierlucSS

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" …

Member Avatar for Airshow
0
112

The End.