You might consider using Validation controls within templates to avoid messing with JScript.
proach
Posts
-
Datagrid -
Error using Login Control with UpdatePanelI believe this has to do with the fact that there are a number of controls that simply cannot be used with UpdatePanel control The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an UpdatePanel control: * TreeView and Menu controls. * Web Parts controls. For more information, see ASP.NET Web Parts Controls. * FileUpload controls when they are used to upload files as part of an asynchronous postback. * GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false. * Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates. * The Substitution control. * Validation controls, which includes the BaseCompareValidator, BaseValidator, CompareValidator, CustomValidator, RangeValidator, RegularExpressionValidator, RequiredFieldValidator, and ValidationSummary control. See this for details
-
DatagridI would recommend converting your GridView columns to templates and then attach appropriate JScript handlers to input fields.
-
System.IO.FileSystemWatcher problemHello there, I need to monitor changes made to a certain file from ASP.NET website application. I decided to accomplish this using System.IO.FileSystemWatcher. Currently I am having the following problems 1. I can't make my watcher monitor a single file not just the whole folder content. 2. Even if I try the whole-folder-monitoring scenario it turns out that the Change event fires 5 times instead of 1. Any magic behind this number? Here's the source code inside my Global.asax file. Commented lines include adjustments I tried to enable monitoring specific file.
1 void Application_Start(object sender, EventArgs e) 2 { 3 // Code that runs on application startup 4 5 6 7 System.IO.FileSystemWatcher __file_watcher = new System.IO.FileSystemWatcher(); 8 Application.Add("AdConfigurationWatcher",__file_watcher); 9 __file_watcher.Path = Server.MapPath("~/"); 10 __file_watcher.IncludeSubdirectories = false; 11 __file_watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite; 12 //__file_watcher.Filter = "myconfig.xml"; 13 14 15 __file_watcher.Changed += new System.IO.FileSystemEventHandler(__file_watcher_Changed); 16 17 __file_watcher.EnableRaisingEvents = true; 18 } 19 20 void __file_watcher_Changed(object sender, System.IO.FileSystemEventArgs e) 21 { 22 //do whatever.... this is just for tracing 23 System.IO.WatcherChangeTypes c = e.ChangeType; 24 } 25 26 void Application_End(object sender, EventArgs e) 27 { 28 // Code that runs on application shutdown 29 System.IO.FileSystemWatcher __file_watcher = Application["AdConfigurationWatcher"] as System.IO.FileSystemWatcher; 30 Application.Remove("AdConfigurationWatcher"); 31 __file_watcher.Dispose(); 32 }
-
System.IO.FileSystemWatcher problemHello there, I need to monitor changes made to a certain file from ASP.NET website application. I decided to accomplish this using System.IO.FileSystemWatcher. Currently I am having the following problems 1. I can't make my watcher monitor a single file not just the whole folder content. 2. Even if I try the whole-folder-monitoring scenario it turns out that the Change event fires 5 times instead of 1. Any magic behind this number? Here's the source code inside my Global.asax file. Commented lines include adjustments I tried to enable monitoring specific file.
1 void Application_Start(object sender, EventArgs e) 2 { 3 // Code that runs on application startup 4 5 6 7 System.IO.FileSystemWatcher __file_watcher = new System.IO.FileSystemWatcher(); 8 Application.Add("AdConfigurationWatcher",__file_watcher); 9 __file_watcher.Path = Server.MapPath("~/"); 10 __file_watcher.IncludeSubdirectories = false; 11 __file_watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite; 12 //__file_watcher.Filter = "myconfig.xml"; 13 14 15 __file_watcher.Changed += new System.IO.FileSystemEventHandler(__file_watcher_Changed); 16 17 __file_watcher.EnableRaisingEvents = true; 18 } 19 20 void __file_watcher_Changed(object sender, System.IO.FileSystemEventArgs e) 21 { 22 //do whatever.... this is just for tracing 23 System.IO.WatcherChangeTypes c = e.ChangeType; 24 } 25 26 void Application_End(object sender, EventArgs e) 27 { 28 // Code that runs on application shutdown 29 System.IO.FileSystemWatcher __file_watcher = Application["AdConfigurationWatcher"] as System.IO.FileSystemWatcher; 30 Application.Remove("AdConfigurationWatcher"); 31 __file_watcher.Dispose(); 32 }
-
sockets in mfcam i using sockets correctly?
class CMySocket : public CAsyncSocket { public: CMySocket() : CAsyncSocket() {} void OnAccept() { _tprintf(_T("incoming connection\n")); } }; //and then later if( !AfxSocketInit() ) _tprintf(_T("Cannot init sockets")); CMySocket* sock = new CMySocket; if( sock->Create(1935,SOCK_STREAM,FD_READ | FD_WRITE) ) _tprintf(_T("Created!\n")); if( sock->Listen() ) _tprintf(_T("Listening!\n")); delete sock;
the thing is that listening doesn't seem to get aby results though another app connects to that port. i am sending data from my FLASH movie via XMLSocket object but no result :( -
Bots for online game?I am sorry if i don't make much sense but this is because I don't quite know what i am looking for. What I want to do is create a program that can play PHP based online game automatically. It will have to be able to exchange some data with the server so I assume that it is some kind of client application. I was looking into doing this via IHTMLDocument interface and using some Java Scripts but i think it is not as straight forward as it might be. any suggestions?