I have a custom asp.net calender control that does everything on the client through javascript, and when the user clicks save, the control serializes its state into a hidden field which is then parsed on the server and saved into a database. The problem i have is how to know when the page is posting back, so the control can save its state in the hidden field. When i add a event handler through Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(MySaveMethod);
the changes to the hidden field do not show up on the server, but if i first save the state through a custom click event (onclick="MySaveMethod")
and then submit the page i do see the saved state. It seems that when using the PageRequestManager
the controls are already disposed or the postback is already in action and any changes i make is lost. I want to be able to intercept a postback request, save the control state in the hidden field and retrieve it on the server. Thanks in advanced
Yona Low
Posts
-
Ajax Postback -
OutputCache Duration Maximum ValueThanks
-
OutputCache Duration Maximum ValueI'm wondering what the maximum value is for the 'Duration' attribute in the OutputCache Directive. I have some aspx pages for the only reason that they have master pages to form a universal layout throughout the site, other then that they are completely static and i would like to cache them for as long as possible so they dont have to execute on each request. Any idea? Thanks in advanced
-
DataTable NOT to assign Primary KeyHi, I have a Typed DataTable created by the DataSet Designer with a Primary Key (let's say ID). I've setup SQL Server to set the ID field to auto insert if no value is supplied. The problem is that the DataTable has set the IDColumn.Unique = True and the IDColumn.AllowDBNull = False, so when i insert new rows into the DataTable, the DataTable will assign unique keys to the ID column but the assigned id might already be in the database, so when i update the DataTable it fails. When i try to set the Unique Property of the ID field to false (so i can set all ID fields to NULL and the db will fill them) Visual Studio will complain that its a primary key field which needs to be unique. So basically i want to be able to insert into a DataTable 1000 new rows and the db should assign their PrimaryKey and not the DataTable. Thanks in advanced
-
Field Type for SQL TableYou have a very good point about the performance (although its not in the db its in the app which is generally cheaper) The problem of adding a new payment type hit me as well. Initially i decided i can save a list of payment types in a configuration file and add the new one there, i figured its not that often that i will be adding a new payment type anyway. But why reinvent the wheel when i can have that list saved in the db itself. Thanks for the reply
-
Field Type for SQL TableHi, I was wondering if someone could point me in the right direction for the following problem: I created a SQL database which includes a payment system to process customer payments, when defining the Table which will hold the Payments from customers, I couldn't decide if i should create a table for Payment Types (cash, credit card, checking etc...) and add a relationship for each customer payment to the Payment Type table, or use a set of predefined characters to identify payment types (S=cash, C=credit card, H=checking etc...) A payment type table is definitely more in compliance with the relational database modal, but on the other hand, since i will at most only have 4 or 5 payment types it will offer much better performance since there is no joins and PK/FK constraints and it will save space as well.
-
File InfoIf you are talking about a local network, then you can just share the folders you want to browse. if you are talking about any computer on the internet, then you will have to create a server/client application, install the server on the remote computer, and the server will have to provide a protocol-like api for the client (you computer) to consume, including folder browsing requests.
-
Is This True ?I actually downloaded and installed the software from the website and it turns out the people who stole the code did change the copyright notice to themselves (2002-2006)
-
Is This True ?Look like there is a company publishing this program kakang
-
Is This True ?when clicking on the second links, my browser brings up the article and shifts down to the comment (i think the 28th)
-
Is This True ?PIEBALDconsult wrote:
Looks like that second link doesn't bring up the actual comment.
Looks to me like it works
-
Is This True ? -
Programmatically "corrupt" an mp3 fileThere are countless of samples and articles on how to encrypt files here on the code project
-
Programmatically "corrupt" an mp3 fileWhy don't you encrypt the file ? this way its theoretically corrupted and you can reverse it with the right password
-
inserting value in start of arrayIn .NET 2.0 this is 2 lines
Dim byteList As New List(Of Byte)(New Byte() {255, 255, 255, 255}) byteList.AddRange(UTF8.GetBytes("TESTSTRING"))
Since in .NET 2.0 the List is Generic, you can use the
ToArray
Methohd to get a byte array of thebyteList
on the fly Example:Dim pass() as byte = byteList.ToArray
Or even in method calls:
Dim writer As New BinaryWriter(New FileStream("C:\test.txt", FileMode.CreateNew)) writer.Write(byteList.ToArray)
-
Threading Priority?I’m creating a network application which consists of a server and client-both windows applications, for each client that connects to the server the server will create a thread to handle that clients requests. One of the features will need to have very accurate and fast transfers between the client and server, which means that the server will need to run very efficiently, since I don’t want to restrict the server to run on dedicated hardware I was thinking of making the priority higher, which brings me to my question: Should I set each thread that handles a client to a higher priority, or should I set the process from the server application to a higher priority. And will I achieve better performance if I set both to a higher priority or setting one to high is the same as setting both (in other words, does windows have 5 levels of priority or 25 (5x5) levels of priority? ) Answers to any part of this post will be greatly appreciated.
-
Regarding text box controlRmesh wrote:
textboxbox1.text=(i,j)
textboxbox1.Text = (i.ToString & j.ToString)
-
code to "sniff" file header to determine file typeSearch google for "file formats for programmers", and you'll find excellent results on this topic
-
Error Messagejds1207 wrote:
If InvalidCharacterCheck(row("PartNumber") = True Or InvalidCharacterCheck(row("mostforwardpartnumber"))) = True Then
i think it needs to be like this If InvalidCharacterCheck(row("PartNumber")) = True OrElse InvalidCharacterCheck(row("mostforwardpartnumber")) = True Then
-
Slideshow ScreensaverI think Visual Basic express edition comes with a starter pack that includes a screen saver.