Covert javascripts to use in code behind form

How to convert a javascripts below to use in code behind form?

<script type="text/javascript">
document.getElementById('Ok').disabled = true;
setTimeout(function(){
  document.getElementById('Ok').disabled = false;
}, 15000);
</script>

Convert to:

Dim strJScript As New StringBuilder
strJScript.Append("document.getElementById('" + Ok.ClientID + "').disabled
=true;")

//help to convert below code:

------

setTimeout(function(){
  document.getElementById('Ok').disabled = false;
}, 15000);


------
ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
ToString(), True)

-- 
Message posted via http://www.dotnetmonster.com

0
aspfun
2/25/2010 4:47:57 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

2 Replies
802 Views

Similar Articles

[PageSpeed] 44

Just do exactly what you did with the first chunk of code, embed it as a 
string in a StringBuilder and then send it to the client.  There's really no 
"conversion" here at all, just sending client code to the client from the 
server.

-Scott


"aspfun via DotNetMonster.com" <u53138@uwe> wrote in message 
news:a42b47f47991d@uwe...
> How to convert a javascripts below to use in code behind form?
>
> <script type="text/javascript">
> document.getElementById('Ok').disabled = true;
> setTimeout(function(){
>  document.getElementById('Ok').disabled = false;
> }, 15000);
> </script>
>
> Convert to:
>
> Dim strJScript As New StringBuilder
> strJScript.Append("document.getElementById('" + Ok.ClientID + "').disabled
> =true;")
>
> //help to convert below code:
>
> ------
>
> setTimeout(function(){
>  document.getElementById('Ok').disabled = false;
> }, 15000);
>
>
> ------
> ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
> ToString(), True)
>
> -- 
> Message posted via http://www.dotnetmonster.com
> 


0
Scott
2/25/2010 6:13:53 PM
On Feb 25, 5:47=A0pm, "aspfun via DotNetMonster.com" <u53138@uwe> wrote:
> How to convert a javascripts below to use in code behind form?
>
> <script type=3D"text/javascript">
> document.getElementById('Ok').disabled =3D true;
> setTimeout(function(){
> =A0 document.getElementById('Ok').disabled =3D false;}, 15000);
>
> </script>
>
> Convert to:
>
> Dim strJScript As New StringBuilder
> strJScript.Append("document.getElementById('" + Ok.ClientID + "').disable=
d
> =3Dtrue;")
>
> //help to convert below code:
>
> ------
>
> setTimeout(function(){
> =A0 document.getElementById('Ok').disabled =3D false;
>
> }, 15000);
>
> ------
> ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
> ToString(), True)
>
> --
> Message posted viahttp://www.dotnetmonster.com

Dim strJScript As String
strJScript =3D "setTimeout(function()
{document.getElementById('Ok').disabled =3D false;}15000);"
0
Alexey
2/25/2010 6:58:24 PM
Reply:

Similar Artilces:

Check if field is empty (what code to use)
In a form's BeforeUpdate I check if certain fields are empty, and if that's the case I cancel the BeforeUpdate. I always use this kind of code for that: If IsNull([Surname] or Surname = "" then However, I noticed that others use other ways for checking this: If Len(Nz([Surname],"")) = 0 Then If Len(Trim([Surname] & "")) = 0 then If RTrim([Surname].Text) = Nothing Then If Nz([SurName],"") = "" Then I'm wondering what I can use best in this case. Also I'm wondering, why do you have to check for a ""...

error on MSPST32.DLL in outlook 2003 when using /PAE switch.
Hi all, On a windows 2003 server, when using the /PAE switch in the boot.ini file like describe in this article : http://support.microsoft.com/?id=255600, we cannot create or import a PST file in Outlook 2003. The error message is talking about the MSPST32.DLL file. Do you have heard about this ? Regards, St�phane ...

Use the important patch from the MS
--kkfhcgwdqxnib Content-Type: multipart/related; boundary="bquhfctweaitbecqg"; type="multipart/alternative" --bquhfctweaitbecqg Content-Type: multipart/alternative; boundary="ugallqgiza" --ugallqgiza Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Partner this is the latest version of security update, the "October 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to continue keeping your computer secure from th...

Use of OpenArgs
I am opening a form called frmFindPerson from a form called frmEditPerProj. I am passing the form name of the first form to the second form by placeing it in openArgs in doCmd.OpenForm as "frmEditPerProj". I want to select a record from the second form and pass a field value back to the first using the form name passed in OpenArgs to define the field to be filled with this data. I was not sure whether I could use OpenArgs dircetly so I have set up a variable and assigned the value of OpenArgs to it as follows Private Sub cmdSelect_Click() Dim strFormName As String strFormName = For...

Find MAX of column from using 2 criterias
Spreadsheet (duh) with 3 columns: Month, Vehicle Licence #, Odometer readings. Now looking at the Month and Vehicle Licence #, what is the lowest odometer reading and also what is the highest odometer reading, so as to calculate the distance travelled. Do not want to use Pivot tables - as columns will grow. Do not want to use array formula as end user is as useless as putting butter on bread with a toothpick. Thanks in advance. Hi, Try this array formula. =MIN(IF(MONTH(A1:A20)=D1,IF(B1:B20=E1,C1:C20))) Change MIN to MAX to get the max value D1 is a number i.e. 4 fo...

Unable to repy using word editor
When repyling to an e-mail I receive the following message, "This form requires Word as your e-mail editor, but Word is either busy, or cannot be found. The form will be opened in the Outlook editor instead". I found article 284900, that states you may get this message when you have office 2000 and office xp installed on the same computer. This is not the case on my computer, Office 2000 does not exist, only office xp. Can anyone help me? There appear to be a whole host of causes for this error message. Most have no solution. Here are a few that do: http://support.microsoft...

how to covert a jpeg to a word document?
I scanned articleand saved as a jpeg i want to put the text in a word document also use the pictures seperately any ideas how? Sounds like you need OCR (optical character recognition) software and rescan it creating a Word or other word processor document. -- Don Vancouver, USA "aisha stacey" <aisha stacey@discussions.microsoft.com> wrote in message news:79D8C2CE-6691-48CA-AD4C-833F68B47333@microsoft.com... > I scanned articleand saved as a jpeg i want to put the text in a word > document also use the pictures seperately any ideas how? basically you can't....

Use of Folder List
Somebody HELP me! I have many folders at folder list section. and use of mail rules, mails go to a specific folder for sorting. Problem is that unless all of the folders are seen on the folder list section, I cannot tell if I received a mail or not. How can I make it that when a mail comes in to a sub-sub-folder, main folder will become bold letters to tell me that it is unread mail is in somewhere in the folder family? Please let me know. I am using xp outlook. My Mac Enourage does it fine. Thank you!!! ...

how do i use the organize feature with my hotmail inbox?
I am a new outlook user and I am having some trouble getting all my ducks in a row*. I have set-up my Hotmail accout on outlook and I am able to access my hotmail email in outlook, but I can't use the 'organize' feature** in the Hotmail inbox. It is in the drop-down menu, but it's grey (or not availabe). Do I have to transfer the email to the personal folder? or is there something I am missing? Any help on detailed info on setting things up for a lame-o newbie that can't figure it out on her own would be greatly appreciated. *I am trying to color code messages in m...

Searching a Table on a Form Using Drop Down Text Boxes
I need my form to be able to pull information from fields in my table and list all of the entries entered in that field in a drop down box on my form. I got one of my boxes to display all the ID numbers, but when I go to the Name box and click the down arrow for the drop down options it displays the same ID numbers as the other box. Why doesn't it show the names instead? I want the ID box to display all the ID's in it's drop down, and the Name box to display all the names in it's drop down. Those are the only 2 boxes on the form. Also, how do I take those results of the se...

coverting pub files to jpeg
How do i convert a multipage publisher file to jpeg so i can send to someone via email who does not have publisher? -- I am new to windows xp and am looking for help and guidance. I appreciate your time. Thanks people Convert it to pdf. You can get a free or inexpensive pdf converting program at: Primopdf at www.Primopdf.com it's free or a low cost program, PDF-XChange at; http://www.docu-track.com/ -- Don Vancouver USA "kezaaa" <kezaaa@discussions.microsoft.com> wrote in message news:E8546816-9E55-4BB3-B03F-1D42555F98F6@microsoft.com... > How do i conver...

Re-authenticate using dialup and offline folders
I'm using Office XP, Windows XP and offline folders on the clients. Exchange 5.5 is used on the mail servers. User are connecting through dialup to our network. When they start synchronizing with the mail servers, they have to logon again to the domain again, although they are already logged on to the domain and PASSWORD AUTHENTICATION is used. If we are downgrading the client to Outlook 2000, the problem does no longer exist. Does anyone have an idea? Thanks Juergen ...

Countif function using times
Hello All, I'm using Windows and Excel XP. I am trying to count the number of occurences of times in a certain range. For example: A ----------------------- 1 0:15:03 (0 hours, 15 minutes and 3 seconds) 2 0:22:45 3 0:17:33 4 0:13:22 5 0:21:00 6 0:16:01 I would like to find the number of occurences that fall between the times of 0:15:00 and 20:00 (which would be 3). I am having a problem writing the formula =COUNTIF(A1:A6,">=0:15:00<0:20:00"). It is returning the #VALUE! error. Not sure i...

JavaScript Breakpoints
Hi, I set a breakpoint on line of JavaScript code within an aspx file. The debug IDE ignores it. How can I enable JavaScript breaking ? King On Dec 2, 7:37=A0am, "King Coffee" <kcof...@hotmail.com> wrote: > Hi, > > I set a breakpoint on line of JavaScript code within an aspx file. The de= bug > IDE ignores it. How can I enable JavaScript breaking ? > > King What version of IDE do you have? See more at this page http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugg= ing.aspx King Coffee wrote: > Hi, > ...

Coverting to 2007
How do I convert Access 2002 versions 2007 versions in Access 2007. I just upgraded to 2007 and all of the quesries, tables etc are still in 2002 version. Unless you need something that is unique to 2007, such as attachment fields, I recommend just leaving it in the 2002-2003 file format. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Gringarlow" wrote: > How do I convert Access 2002 versions 2007 versions in Access 2007. I just > upgraded to 2007 and all of the quesries, tables etc are still in ...

What category to use for a reimbursed personal Job expense
Hi there! In MS money plus home and business edition, what category do i use for a Job expense that was reimbursed to me. MSMoney has the Category, as expense, of: Job Expense, and under that with subcategories of: 1-Non-reimbursed 2-Reimbursed However, there is no associated income for this. So once i get the reimbursed payment from my company, what do i do? Which category, under income should i use. Also, the "Reimbursable" tick box is always grayed out. What am i missing here? Appreciate a lot any help, =Dee You could create an Income category. Other Income : Job ...

Using filtered form data as record source for report
I have a split form in an Access 2007 database where the data grid shows the records from a query. The user can filter any combination of fields from the the drop down headers. I have a command button above the data grid that opens a report with the same query as its record source. I'm trying to figure out how to pass the filtered data to the report so it will show only those records that the user is seeing in the data grid of the split form. Any help with this issue will be greatly appreciated. Ken You may be able to pass the Filter of your form as the WhereCondition ...

Search using exact criteria for customers
In Point of Sale there should be an option for an 'exact search', so that results that do not match any existing records do not return a result that is similar to what was searched on. Currently users will enter an incorrect or non-existent customer number and will accidentally select the wrong customer instead of receiving an "Invalid number" message. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do n...

Help with SQL coding to select minimum date
I hope I can say this half way intelligently. I have a record set with 2 date fields (One in date and One out date) I have a query to select the records between a specific date range (no problem) now problem: I need to also select the earliest date in at the same time. So thus far I have this code as an expression in empty field: Cohort: IIf([relsdate] Between [7/1/fy] And [6/30/fy],"1"," ") this codes all who are released between my date selection with a 1. Often there are more than one record for a person with different time intervals. Simply, I need to cod...

Use Delete But mailbox not delete
Hi All, How to delete mailbox in exchange 5.5 NT 4.0 after deleting the user in W2k. If you are not running an ADC or do not it configured to delete objects on the 5.5 side, you need to use the Exchange Admin tool and NT 4.0 user manager. -- regards, Michael Abbaticchio MVP for Exchange Server http://mvps.org/exchange "cosy" <anonymous@discussions.microsoft.com> wrote in message news:109b001c3f41a$f7c78140$a001280a@phx.gbl... > Hi All, > > How to delete mailbox in exchange 5.5 NT 4.0 after > deleting the user in W2k. ...

Promted for opening of attachment form Outlook
I have tasks linked to notes in One Note, whenever I click the attachment to open the notebook, I get a "Opening Mail Attachment" you should only open attachments from trustworthy.......... and the " always ask before opening" box is checked and grayed out so I cant change it. Although not the biggest problem in the world, it is an annoyance. Any thoughts on how to eliminate this? -------- Original-Nachricht -------- > I have tasks linked to notes in One Note, whenever I click the attachment to > open the notebook, I get a "Opening Mail...

How do I export a to a text file not using TransferText
I am trying to export data from a form to a text file, but I must sort the fields before exporting them, as in the first field to be the first line and the second field to be start on the next line on the text file and with TransferText I can not accomplish that. please help me with the coding of exporting the data. Thanks a million. This snippet shows how to open a file and write stuff to it: Dim FileSpec As String Dim lngFN As Long Dim strLine As String FileSpec = "D:\Folder\File.txt" lngFN = FreeFile() Open FileSpec For Output As #lngFN strLine = "Conte...

How to select Chart without using Mouse?
Hi.... Is there any option on how to select the chart without using mouse button. Ex.: I have created the bar chart using mouse and clicked on the empty cell.... now tell me how to select that chart without using mouse. Need response at the earliest. Regards On Mon, 30 Jul 2007, in microsoft.public.excel.charting, Rajkumar <Rajkumar@discussions.microsoft.com> said: >Is there any option on how to select the chart without using mouse button. Alt-E Edit menu G Go To.. Alt-S Special Alt-b Objects Enter Tab until you get to the chart object you want Context menu ke...

MSPOS: When I print a label with a barcode, the barcode uses the e
MSPOS: When I print a label with a barcode, the barcode uses the entire field length Course then the bar code reader can't scan it. It appears that the program is attempting to always use the entire width of the field instead of printing within the field size like RMS does. 5 numbers in ILC, any barcode type, barcode label field size 1.5" wide, always prints the barcode 1.5" wide Use a Dymo 330 Turbo printer, Windows driver using the same label format/info and field sizes that works fine in RMS and all other programs Sure glad I'm not selling this!! 4 bugs/_feat...

Adding formatting codes to Excel
I'm sure I have to be missing something simple but I just want to add customer formatting code to Excel to augment code that is already there. However, I have not found a way to do this. My code is simple, something like [red][<100]0.0;[black][>=100]0.0 but every time I open Excel with a new sheet I am working with, the codes have to be manually typed in for the first edit of the sheet/workbook. Any way to do this? Thanks in advance... Thomas Geery By the way, I realize that the code [red][<100]0.0 by itself would work the same as the code I typed in the original mes...