Tuesday, June 26, 2007

Good Links For Developer's(DotNet)

http://media.spikedhumor.com/8944/Jingle_Bells_Reversed.swf
http://www.c-sharpcorner.com/UploadFile/sd_patel/EditUpdateDbRecord11222005013317AM/EditUpdateDbRecord.aspx?ArticleID=4e32fac9-7b00-4252-9b4b-0e99f5b049ad
http://builder.com.com/5100-6373-1050171.html
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=66
aspemail.com
***********File Upload*********
http://www.freevbcode.com/ShowCode.Asp?ID=2136
http://www.developerfusion.co.uk/show/5449/
http://www.developer.com/net/asp/article.php/3097661
http://www.developer.com/net/asp/article.php/3097661
http://www.stardeveloper.com/articles/display.html?article=2003022601&page=1
http://support.microsoft.com/kb/323245/EN-US/
http://www.upyourasp.net/articles/article.aspx?aid=4
http://www.codetoad.com/asp.net_multiplefileupload.asp
http://www.4guysfromrolla.com/webtech/091201-1.shtml
http://support.microsoft.com/kb/323245
http://www.aspheute.com/english/20000802.asp
http://www.codeproject.com/aspnet/fileupload.asp#set
*******************************
http://www.datawebcontrols.com/faqs/Hyperlinks/HyperlinkThatOpensInANewWindow.shtml(hyperlink)

***/text editor toll bar/********
http://cutesoft.net/example/general.aspx
http://www.richercomponents.com/asp-net-components/rich-text-box/features.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebMailMailMessageMembersTopic.asp
********************
http://www.codeguru.com/forum/archive/index.php/f-15-p-7.html
*****user control****
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconinstantiatingusercontrolsprogrammatically.asp
******datagrid****
http://msdn2.microsoft.com/en-us/library/fdcwwhez.aspx
http://msdn2.microsoft.com/en-us/library/zz890s97.aspx
http://www.programmingknowledge.com/
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkWalkthroughUsingDataGridWebControlToReadWriteData.asp
http://www.dotnetjunkies.com/Article/8F9AB317-1969-49FB-BC95-D2596BFDF5CB.dcik
*******stored procedures****
http://www.macronimous.com/resources/stored_procedures_for_ASP_and_VB_Programmers.asp
http://www.sqljunkies.com/Article/4EC83A05-37CA-479D-94D9-04EAFE7705F9.scuk
http://www.411asp.net/home/tutorial/howto/database/storedpr
http://www.google.com/search?client=opera&rls=en&q=calling+stored+procedures+in+asp.net&sourceid=opera&ie=utf-8&oe=utf-8
**********email******
http://www.systemwebmail.com/faq/2.1.aspx
********developer's introduction to web parts******
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_SP2003_ta/html/sharepoint_northwindwebparts.asp


Sub SendEmail()
Dim strTo As String
Dim strFrom As String = "webmaster@silverjewelryclub.com"
Dim strSubject As String = "Profile Updation Confirmation - Silver Jewelry Club"
Dim msgText As String = "You made changes to your profile. Your userId is: " + txtEmail.Value + " and Pass word is: " + txtPassword.Value

strTo = txtEmail.Value

SmtpMail.Send(strFrom, strTo, strSubject, msgText)

End Sub



*********javascript***************************************************************
http://www.smartwebby.com/DHTML/phone_no_validation.asp
popup window--http://www.codetoad.com/javascript/pop_up_window.asp
http://javascript.internet.com/forms
http://www.irt.org/script/18.htm
popup----http://www.codetoad.com/asp.net/
popup-----A href="javascript:PopUp('ForgotLoginInfo.aspx')" in javascript


http://yaldex.com/FSMenusAndNavigation.htm
http://www.hypergurl.com/generators/

Disable back button in JS: http://www.boutell.com/newfaq/creating/backbutton.html
http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911
http://www.codeproject.com/useritems/NoCaching.asp


Validation For Alphabets
onkeypress="if (event.keyCode < 45 || event.keyCode > 57) {alert('only Numeric');event.keyCode=0;}"

***********auto refresh url*********************************
Just include the following tag in the head tag,
meta http-equiv="refresh" content="5"
This will refresh for each 5 seconds.
*************************csv format converting*****
http://www.dotnetbips.com/articles/displayarticle.aspx?id=302
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbConn As New SqlClient.SqlConnection("server=USER-TN67TE5HWZ;database=sjc;uid=sa;pwd=")
Dim sw As StreamWriter = New StreamWriter("c:\TestFile.csv")

Dim cmdCheck As New SqlClient.SqlCommand
Dim drCheck As SqlClient.SqlDataReader
Dim str1, str2 As String
str1 = Me.shipdate1.Value
str2 = Me.shipdate2.Value
dbConn.Open()
cmdCheck.CommandText = "Select ORDERID,ORDERDATE,BILLFIRST,BILLLAST,BILLADDRESS1,BILLADDRESS2,BILLSTATE,BILLZIP,BILLPHONE,BILLEMAIL,SHIPFIRST,SHIPLAST,SHIPADDRESS1,SHIPADDRESS2,SHIPCITY,SHIPSTATE,SHIPZIP,SHIPPHONE,ITEM,DESCRIP,PAYMETHOD from orders where orderid between '" & str1 & "' and '" & str2 & "'"
cmdCheck.CommandType = CommandType.Text
cmdCheck.Connection = dbConn
drCheck = cmdCheck.ExecuteReader()
While drCheck.Read()
sw.WriteLine(drCheck.GetInt32(0).ToString & "," & drCheck.GetDateTime(1) & "," & drCheck.GetString(2) & "," & drCheck.GetString(3) & "," & drCheck.GetString(4) & "," & drCheck.GetString(5) & "," & drCheck.GetString(6) & "," & drCheck.GetString(7) & "," & drCheck.GetString(8) & "," & drCheck.GetString(9) & "," & drCheck.GetString(10) & "," & drCheck.GetString(11) & "," & drCheck.GetString(12) & "," & drCheck.GetString(13) & "," & drCheck.GetString(14) & "," & drCheck.GetString(15) & "," & drCheck.GetString(16) & "," & drCheck.GetString(17) & "," & drCheck.GetString(18) & "," & drCheck.GetString(19) & "," & drCheck.GetString(20))
End While
sw.Close()
End Sub
*****************************webconfig*************
Dim dbConn As New SqlClient.SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("ConnectString"))
cn = New SqlConnection
Dim strConnect As String = System.Configuration.ConfigurationSettings.AppSettings("ConnectString"
cn.ConnectionString = strConnect
cn.Open()
********************************sql-exception*************
If ds.Tables("affiliates").Rows.Count > 0 Then
password = ds.Tables("affiliates").Rows(0)("password")
End If
If Not password = Nothing Then
SendEmail()
Response.Redirect("default.aspx")
*******************************ASP.NET FAQS**********************
http://www.syncfusion.com/faq/aspnet/default.aspx
http://www.syncfusion.com/faq/aspnet/default.aspx
http://www.allscoop.com/netcounter.php


*****************Stored Procedures************************************
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=49
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet09102002.asp
http://www.411asp.net/home/tutorial/howto/database/storedpr?pg=3&order=desc
http://www.dotnetjunkies.com/Tutorial/9AE62C44-3841-4687-B906-2F6D4A5A4622.dcik
http://www.411asp.net/home/tutorial/howto/database/storedpr?pg=2&order=desc
http://aspnet.4guysfromrolla.com/articles/070203-1.aspx
http://www.123aspx.com/redir.aspx?res=31118
http://www.dotnetjunkies.com/Article/9AE62C44-3841-4687-B906-2F6D4A5A4622.dcik
http://www.411asp.net/home/tutorial/howto/database/storedpr?pg=2&order=desc
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet09102002.asp
http://www.orcsweb.com/articles/aspdotnet_stored_procedures.aspx
http://vyaskn.tripod.com/code.htm
http://aspnet.4guysfromrolla.com/articles/062905-1.aspx




*************************SQL QUERY********************************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_15_7lup.asp
http://search.msdn.microsoft.com/search/results.aspx?qu=contains&View=msdn&st=b&c=0&s=1&swc=0
Import data from excel to SQL sever---http://support.microsoft.com/default.aspx?scid=kb;en-us;321686
*****************Connection Strings***************************
http://www.connectionstrings.com/

*********************MySQL *****************************************
http://dev.mysql.com/doc/refman/4.1/en/connector-net-using-stored.html?ff=nopfpls
http://dev.mysql.com/doc/refman/5.0/en/selecting-rows.html?ff=nopfpls
http://www.15seconds.com/issue/050407.htm
http://dev.mysql.com/doc/refman/4.1/en/connector-net-using-connecting.html
http://dev.mysql.com/doc/refman/4.1/en/connector-net-using-prepared.html
http://www.15seconds.com/issue/050407.htm
http://dev.mysql.com/doc/refman/5.0/en/insert.html
http://www.techiesabode.com/show/show_tips_w.php?tip_id=5
http://www.namepros.com/webmaster-tutorials/15188-tutorial-getting-started-with-mysql-basics.html
http://www.devshed.com/c/a/MySQL/Date-Arithmetic-With-MySQL/
http://www.smartwebby.com/PHP/mysqlquery.asp
http://www.tizag.com/mysqlTutorial/mysqldelete.php
http://www.webdevelopersnotes.com/tutorials/sql/my_sql_tutorial_updating_records.php3
http://www.plus2net.com/sql_tutorial/mysql_insert_id.php
http://www.pantz.org/database/mysql/mysqlcommands.shtml
http://helpguide.inmotionhosting.com/mysql_faq/manual_Error-handling.html
http://jan.kneschke.de/projects/mysql/




**********************SESSION IN ASP.NET*************
http://ase.tufts.edu/its/webDtAspDotNetSession.htm

**********************Shopping Cart*************************
http://www.c-sharpcorner.com/Code/2004/April/ASPNetShoppingCart.asp
http://www.dotnetspider.com/projects/ShoppingCart.aspx
http://www.codetoad.com/asp.net/
http://www.dotnetheaven.com/Uploadfile/munnamax/ShoppingCart02102006010016AM/ShoppingCart.aspx
http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET11/aspnet11-05.aspx
http://www.thescripts.com/forum/thread473803.html


*******************RSS FEEDS in ASP.NET*********************************
http://blogs.msdn.com/dmitryr/archive/2006/03/26/561200.aspx
http://www.codersource.net/asp_net_rss_feeds.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-createrssw-aspnet.asp
http://www.geekpedia.com/tutorial147_Creating-an-RSS-feed-reader-in-Csharp.html-----GOOD Article---------
http://aspnet.4guysfromrolla.com/articles/102903-1.aspx
http://www.willasrari.com/blog/create-keyword-filtered-rss-feeds-using-xmldatasource/000107.aspx---Filter RSS with keywords-------------------------
http://scottonwriting.net/demos/RssFeedDemos.aspx

********************ASP.NET******************************
http://geekswithblogs.net/jawad/category/1638.aspx?Show=All
http://www.developersdex.com/asp/default.asp?p=908
http://www.scripts20.com/script/145/6304/Simple_Upload_PHP_Script.html
http://www.php.happycodings.com/code_snippets/code1.html
http://www.snippetcollection.com/
http://www.bhashaindia.com/Developers/Tutorial/
http://www.askasp.net/main.asp
http://www.codersource.net/asp_net_rss_feeds.aspx
http://www.dotnetwatch.com/ASP.NET.aspx
http://www.megasolutions.net/FAQ/aspnet/ASP_Net_FAQs.aspx
http://steveorr.net/articles/EasyUploads.aspx
http://steveorr.net/articles/ImproveYourImages.aspx


***********Repeater with check box*********************
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.webcontrols/browse_frm/thread/279624bf615ec61/bd1ac44e1ff380e9?hl=en&lr=&ie=UTF-8&oe=UTF-8&rnum=4&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26scoring%3Dd%26q%3Drepeater%2Bcheckbox%2Bvalue%26sa%3DN%26tab%3Dwg
http://p2p.wrox.com/topic.asp?TOPIC_ID=34550
http://www.derkeiler.com/Newsgroups/microsoft.public.dotnet.framework.aspnet.security/2004-03/0235.html
http://www.dotnetjunkies.com/WebLog/davetrux/archive/2003/12/10/4371.aspx




****************General SQL (DB) Queries******************
http://sqlzoo.net/howto/source/z.dir/tip241027/i02create.xml


***************Getting value of datakey in datagrid*******************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkWalkthroughUsingDataGridWebControlToReadWriteData.asp


*************search engine optimization*************************************
http://www.codetoad.com/asp.net/
http://www.bruceclay.com/web_rank.htm
http://www.wwwcoder.com/main/parentid/457/site/6173/68/default.aspx



****************************Free Projects with sourcecode*****************

http://www.dotnetspider.com/projects/ViewProjects.aspx

*************Search *****************************************
http://www.digioz.com/links.php


*****************************Date in ASP.NET**************
http://www.vbcity.com/forums/faq.asp?fid=6&cat=Date%2FTime
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=181
http://www.developerfusion.co.uk/show/3244/
http://www.dotnetspider.com/kb/Article552.aspx


****************For Each Loop************************
http://www.dotnet247.com/247reference/msgs/56/280341.aspx
http://www.codeguru.com/vb/controls/vbnet_controls/listview/article.php/c7923/
http://answers.google.com/answers/threadview?id=111370
http://www.vb-helper.com/howto_net_bug_for_loop_nothing.html



*************************PHP--MySQL*****************************
http://www.databasejournal.com/features/mysql/article.php/10897_1469211_2
http://www.adobe.com/devnet/dreamweaver/articles/php_iis.html#cgi
http://www.photosector.com/Sections+index-req-viewarticle-artid-27-page-1.html
http://in2.php.net/manual/en/function.mysql-connect.php
http://in2.php.net/function.mysql-connect


*****************URL Rewriting in ASP.NET*****************************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

****************Finding a string within a document***************************
http://www.codeproject.com/vb/net/extractemail.asp
http://www.vb-helper.com/index_strings.html
http://www.regular-expressions.info/examples.html
http://getdotnetco.web101.discountasp.net/GdncStore/Free.aspx
http://www.vbcity.com/forums/faq.asp?fid=6&cat=Strings


******************Free E-books**********************************************
http://www.flazx.com
http://www.megalinker.tk/

******************Tree View Control********************************************
http://www.levelextreme.net/wconnect/wc.dll?10,7,10,38

*************Regular Expressions Check*****************************************
www.regexlib.com
http://www.users.bigpond.com/conceptdevelopment/Validation/InsensitiveRegularExpressionValidator/

Number(1-6).(1-2):

^((([0-9])|([0-9][0-9])|([0-9][0-9][0-9])|([0-9][0-9][0-9][0-9])|([0-9][0-9][0-9][0-9][0-9])|([0-9][0-9][0-9][0-9][0-9][0-9])).(([0-9])|([0-9][0-9])))$

Date(mm-dd-yyyy):

^((([0-1][0-2])|([0-9]))-(([0-3][0-1])|([0-2][0-9])|([0-9]))-([0-2][0-9][0-9][0-9]))$


****************Multi-Lingual Support**********************************************
http://www.developersdex.com/gurus/articles/500.asp?Page=2
http://weblogs.asp.net/pleloup/archive/2003/11/19/38506.aspx
http://www.codeproject.com/aspnet/localization_websites.asp
http://www.dotnetbips.com/Articles/displayarticle.aspx?id=214
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/html/cpsmpnetsamples-aspnetlocalization.asp
http://aspnet.4guysfromrolla.com/articles/030304-1.aspx
http://www.dotnetspider.com/kb/Article2021.aspx
http://www.codeproject.com/aspnet/ChangeCultures.asp
http://samples.gotdotnet.com/quickstart/aspplus/doc/cultureencoding.aspx
http://lakshmik.blogspot.com/2006/03/aspnet-20-explicit-localization-in.html
http://weblogs.asp.net/guys/archive/2004/08/21/218116.aspx
http://www.dotnetbips.com/Articles/displayarticle.aspx?id=214
http://www.dotnetbips.com/Articles/displayarticle.aspx?id=217
http://www.dotnetbips.com/Articles/displayarticle.aspx?id=218



************************* Mail Merge in Word 2003 using c#.Net****************
http://support.microsoft.com/kb/301659/


***************Split String**********************************
http://www.15seconds.com/issue/010515.htm
http://www.developerfusion.co.uk/show/127/
http://visualbasic.about.com/od/learnvb6/l/blvbsplit.htm
http://www.freevbcode.com/ShowCode.asp?ID=4938


************VB.Net***************
http://www.xmlfox.com/VBsamples.htm


********************Creating Bitmaps from user input string******************
http://www.codersource.net/asp_net_image_generation_from_string.aspx

***********Developing a Simple RSS Reader Custom Control in Asp.net**********
http://www.codersource.net/asp_net_custom_control_rss_reader.aspx



************Creating Setup & Deployment*********************type url in msdn 2003
ms-help://MS.MSDNQTR.2003FEB.1033/vsintro7/html/vbtskcreatinginstallerforyourapplication.htm
How to: Create or Add Deployment Projects
http://msdn2.microsoft.com/en-us/fyh6k4k4.aspx


****************101 Samples for Visual Studio 2005 & 2003******************
http://msdn.microsoft.com/vstudio/downloads/101samples/default.aspx

*********Code Samples From Microsoft******************
http://searchvb.techtarget.com/infoCenter/0,,sid8_iid2657,00.html


********ToolTip, ErrorProvider ***************
http://www.startvbdotnet.com/controls/tooltip.aspx
http://www.codeproject.com/vb/net/vbsplittooltips.asp
http://www.devx.com/vb2themax/Tip/18840


**************PrintDialoginWindowsforms****************
http://www.java2s.com/Code/VB/GUI/DisplayPrintdialog.htm
http://www.vbcity.com/forums/faq.asp?fid=15&cat=Windows+Forms
http://www.daniweb.com/techtalkforums/thread8575.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbcode/html/vbtskcodeexampleprintingform.asp
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c55c.aspx#q491q
http://msdn.microsoft.com/netframework/windowsforms/support/wffaq/default.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/html/cpsmpNETSamples-WindowsFormsPrinting.asp
http://www.codeproject.com/csharp/printform.asp

***************Code:

Dim img As Bitmap
Dim WithEvents pd As PrintDocument

'Returns the Form as a bitmap
Function CaptureForm1() As Bitmap
Dim g1 As Graphics = Me.CreateGraphics()
Dim MyImage = New Bitmap(Me.ClientRectangle.Width, (Me.ClientRectangle.Height), g1)
Dim g2 As Graphics = Graphics.FromImage(MyImage)
Dim dc1 As IntPtr = g1.GetHdc()
Dim dc2 As IntPtr = g2.GetHdc()
BitBlt(dc2, 0, 0, Me.ClientRectangle.Width, (Me.ClientRectangle.Height), dc1, 0, 0, 13369376)
g1.ReleaseHdc(dc1)
g2.ReleaseHdc(dc2)
'saves image to c drive just, u can comment it also
' MyImage.Save("c:\abc.bmp")
Return MyImage
End Function


'this method will be called each time when pd.printpage event occurs
Sub pd_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles pd.PrintPage

Dim x As Integer = e.MarginBounds.X
Dim y As Integer = e.MarginBounds.Y
e.Graphics.DrawImage(img, x, y)
e.HasMorePages = False
End Sub

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
img = CaptureForm1()
pd = New PrintDocument
pd.Print()
End Sub
****End of code**********

***********Passing Value between Window Forms***************
http://www.c-sharpcorner.com/UploadFile/thiagu304/passdata05172006234318PM/passdata.aspx?ArticleID=9d12229f-db06-4687-8c6f-28ab1c57e6e1



*****************Building and using a 3-tiered data architecture********************
http://www.asp.net/learn/dataaccess/default.aspx?tabid=63


************BindingSource.Find Method (String, Object) **************
http://msdn2.microsoft.com/en-us/library/ms158165(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource.aspx



**************Windows Form Help***********************
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c58c.aspx


******************Display Excel in Windows Forms*****************************
http://support.microsoft.com/?scid=kb;EN-US;304643#top
http://www.dotnet247.com/247reference/msgs/55/277921.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k2/html/odc_xlrtdvbnet.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp
http://support.microsoft.com/?scid=kb;EN-US;304643


****************Book to download******************************************
Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath
Eric Carter, Eric Lippert
Addison-Wesley, Paperback, Published September 2005, 800 pages, ISBN 0321334884


********************************************************************************************
A wonderful article about Office PIAs by Chris Kunicki:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office10032002.asp

Working with the Office XP Primary Interop Assemblies:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp

Installing and Using the Office 2003 Primary Interop Assemblies:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2k3ta/html/OfficePrimaryInteropAssembliesFAQ.asp

Download Official Office 2003 PIAs:
http://support.microsoft.com/default.aspx?scid=kb;en-us;897646

Download Official Office XP PIAs:
http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en





*******************ASP.NET 2.0 and Code Snippets*****************************************
http://www.asp.net/learn/absolute/default.aspx?tabid=63
http://www.aspnettutorials.com/tutorials/
http://www.theserverside.net/tt/articles/showarticle.tss?id=DataSetDesigner
http://weblogs.asp.net/scottgu/archive/2006/01/01/434314.aspx
http://www.dotnet-guide.com/rssfeeds.html
http://www.goeleven.com/professional/aggregate.aspx


****************Deciding When to Use the DataGrid, DataList or Repeater******************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-whenusedatawebcontrols.asp

***************Full Text Indexing in SQL SERVER 2000**************************
http://www.fogcreek.com/FogBugz/KB/dbsetup/FullTextSearch.html
http://www.eggheadcafe.com/articles/20010422.asp


************Dynamic DataTable in ASP.Net********************************
http://aspnet.4guysfromrolla.com/articles/082003-1.aspx


*************Creating a Scrollable Data Grid***********************
http://datawebcontrols.com/demos/ScrollableDataGrid.aspx
http://datawebcontrols.com/demos/ScrollableDataGrid.aspx


****************ASP.NET Web Casts**********************************
http://www.microsoft.com/events/series/msdnaspnetoct.mspx



************counting the checked checkboxes with in a datalist**************
you can iterate throug items and check the values and add then in array.

ArrayList arr = new ArrayList();
foreach(DataListItem item in dataList1.Items)
{
CheckBox chk = (CheckBox)item.FindControl("CheckBox",CheckBox);
if(chk != null)
{
if(chk.Checked == true)
arr.Add(chk);
}
}
take the count of arr for total number.


****************CAPTCHA Image********************************
http://www.codeproject.com/aspnet/CaptchaImage.asp?df=100&forumid=32416&exp=0&select=1069596


**********************Request Validation - Preventing Script Attacks******************
*************potentially dangerous Request.Form value**********************
http://www.asp.net/faq/RequestValidation.aspx?tabid=1
http://www.cryer.co.uk/brian/mswinswdev/ms_vbnet_server_error_potentially_dangerous.htm


**********There are plenty of resources on the Web for URL rewriting:****************

http://www.codeproject.com/aspnet/URLRewriter.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp
http://www.15seconds.com/Issue/030522.htm



****************Changing Row color in Datagrid*****************************
http://www.dotnetjohn.com/articles.aspx?articleid=30
http://dotnetjunkies.com/Article/AB92FE75-4C0A-4DDB-94FA-0F14C64DD281.dcik
http://www.codeproject.com/csharp/custom_datagridcolumnstyl.asp
http://www.c-sharpcorner.com/Code/2003/June/FormatDataGridData.asp
http://forums.whirlpool.net.au/forum-replies-archive.cfm/343304.html
http://www.sadikhov.com/forum/lofiversion/index.php/t27002.html
http://www.codeproject.com/vb/net/GraphicGrid.asp
http://www.velocityreviews.com/forums/t95252-in-datagrid-onclick-event-i-want-to-show-some-color.html

Code snippet:

For example, I only want to change the colour of a cell, if that cell is in the "Status" column, and the the cell contains "Fault".

Example DataTable with Three columns: "Order", "Status", and "Notes"

Using the following handler:
Protected Sub HandleOnItemDataBound(ByVal sender As System.Object, ByVal e As DataGridItemEventArgs)

If instr(e.Item.Cells(0).Text,"FAULT",CompareMethod.Text) > 0 Then
e.Item.BackColor = System.Drawing.Color.Red
End If

End Sub


*******************Adding Controls to the Data Grid Footer Item*****************
http://www.extremeexperts.com/Net/Articles/AddingControlstoFooter.aspx


*************************** How to find a file****************************
Directory.GetFileSystemEntrie(*.txt)

***Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged*********
http://www.extremeexperts.com/Net/FAQ/DebuggingProbleminASPNET.aspx

********* Create an N-Tiered Application***************
http://www.15seconds.com/issue/051123.htm

*******************Update XML*****************************
http://www.devnewsgroups.net/group/microsoft.public.dotnet.xml/topic17067.aspx
http://www.devnewsgroups.net/group/microsoft.public.dotnet.xml/topic17084.aspx

************Data grid with JavaScript Alert Message box*************************
http://aspnet.4guysfromrolla.com/articles/090402-1.2.aspx
http://authors.aspalliance.com/aldotnet/examples/cd.aspx
http://www.developer.com/net/csharp/article.php/10918_2210191_2

**************All about Datagrid****************
http://www.c-sharpcorner.com/Code/2003/June/DataGridClientSideEvents.asp
http://p2p.wrox.com/topic.asp?TOPIC_ID=37965
http://www.codeproject.com/aspnet/ItemCreated.asp
http://www.dotnetbips.com/articles/displayarticle.aspx?id=205
http://www.programmersheaven.com/zone26/articles/article725.htm

**************A better refresh button for asp.net pages********************
http://codebetter.com/blogs/peter.van.ooijen/archive/2005/07/19/129384.aspx
http://codebetter.com/blogs/peter.van.ooijen/archive/2006/05/18/144843.aspx
http://codebetter.com/blogs/peter.van.ooijen/archive/2006/05/19/144913.aspx


*************Selecting, Confirming and Deleting Multiple DataGrid items in ASP.NET*******
http://aspalliance.com/427


****************How to extract numbers from string**********************
http://weblogs.asp.net/sushilasb/archive/2006/08/03/How-to-extract-numbers-from-string.aspx


*****************ASP.NET DataGrid Template Columns with Image Button******
c


********************AJAX Technology****************************************
http://www.ajaxpro.info/
www.codeplex.com



****************Using the ATLAS Timer Control to Change Advertisements Without Postbacks***********

http://aspalliance.com/861
Using the ATLAS Drop Shadow Control---http://aspalliance.com/926
Using the ATLAS Modal PopUp Control-----http://aspalliance.com/927
Displaying Running Total from GridView in ATLAS Always Visible Control---http://aspalliance.com/949
Using the ATLAS Toggle Button Control---------http://aspalliance.com/940




*************Merge two datasets into single dataset****************************
http://aspalliance.com/148_Merging_two_Datasets_into_a_single_Datagrid


********************Fundas of .Net 2.0********************
http://www.exforsys.com/content/category/17/266/350/

***********Data Access for .Net 2.0 (SQL Helper Class)******************************************
http://www.devx.com/dotnet/Article/30910#codeitemarea
http://aspnet.4guysfromrolla.com/articles/062503-1.aspx
http://aspnet.4guysfromrolla.com/articles/070203-1.aspx


****************JavaScript Functions**************************************************
http://www.jsmadeeasy.com/javascripts/Calculators/Quadratic%20Equation/index.htm


**********************SQL Transaction*************************************************
http://www.codeproject.com/cs/database/transactions.asp
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=451

******************************FTP Access in ASP.Net***********************************
http://support.microsoft.com/default.aspx?scid=kb;en-us;832679
http://www.dotnethero.com/hero/vbnet/ftp.aspx?nmx=8_4
http://www.codeproject.com/vb/net/FtpClient.asp?forumid=225949&exp=0&select=1667076&df=100
http://msdn2.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx
http://www.enterprisedt.com/products/edtftpnet/choose.html (Free FTP Tool for ASP.Net)


***********************Data List Paging*****************************************************
http://www.dotnetjohn.com/articles.aspx?articleid=48


*****************Make datagrid invisible***************************************************


******************************* ASP.NET Popup Control***********************************


http://www.codeproject.com/aspnet/asppopup.asp

************************************** A Session Data Management Tool****************
http://www.codeproject.com/aspnet/sessiontool.asp

Download Wallpaper www.smstadka.com/galleries.php
Send SMS www.smstadka.com/sms_compose.php
Dating http://www.smstadka.com/register.php
Chatting www.smstadka.com/chat.php
Jokes http://www.darudatheka.com/jokes.php
Free 100000 SMS www.smstadka.com/sms_collection.php
Know your future www.smstadka.com/horoscope.php
Win 50000 Rs on www.smstadka.com/bluffmaster.php
For Jobs http://surl.in/WDMREDDTAC-
Free call http://globe7.com/index.php?refcode=AX10826X345136



********************Merging Two DataTables:***********************************************
http://www.codersource.net/published/view/298/dataset_features_in_asp_net.aspx



********************************Get the current page URL********************************
http://www.powerasp.com/content/new/get-current-page-url.asp



********************************Asynchronous Wait State Pattern in ASP.NET***************
http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/


************************PayPal in ASP.NET*********************************************
https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/software_dev_kit-outside
http://www.devsource.com/article2/0,1759,1766266,00.asp

****************************Grid View Control in 2.0************************************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx08.asp


***********************************ASP.NET Resources*****************************
http://www.4guysfromrolla.com/ScottMitchell.shtml
http://megasolutions.net/FAQ/aspnet/ASP_Net_Miscellaneous.aspx#q54q


*******************************OCR in .NET*****************************************
http://weblogs.asp.net/jgalloway/



***************************Auto Complete Textbox with ATLAS***************
http://atlas.asp.net/docs/Walkthroughs/GetStarted/ServerAutoComplete.aspx
http://www.codeproject.com/useritems/Autocomplete.asp
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=171
http://www.geekzilla.co.uk/View7585D539-C094-4211-9FFC-32FABE4D09B5.htm



********************* Grid View Examples for ASP.NET 2.0**********************
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx.asp
(Multiple values in a cell)
http://aspalliance.com/946_Extended_GridView_Control



********************************Helper Function in Data Grid***********************************

http://aspalliance.com/31


Using JavaScript with ASP.NET Form Elements------http://www.megasolutions.net/kb/JavaScript_ASPNetForm.aspx


*****************Make Reports Quickly With ASP.NET and XML****************************
http://aspalliance.com/475_Make_Reports_Quickly_With_ASPNET_and_XML


************************Crystal Report for Visual Studio .NET********************************
http://aspalliance.com/265_Crystal_Report_for_Visual_Studio_NET


**********************Remove White Space from Text*************************************
http://authors.aspalliance.com/stevesmith/articles/removewhitespace.asp


*****Sending Email in ASP.NET 2.0: HTML-Formatted Emails, Attachments, and Gracefully Handling SMTP Exceptions*************

http://aspnet.4guysfromrolla.com/articles/080206-1.aspx



*************************ASP.NET Expand/Contract Data Grid*************************
http://www.codeproject.com/aspnet/ExDataGrid.asp?df=100&forumid=32882&exp=0&select=813953

************************** Improving the Security in Encrypting Passwords using MD5********

http://aspnet.4guysfromrolla.com/articles/103002-1.2.aspx
http://aspnet.4guysfromrolla.com/articles/112002-1.aspx ------------ (Adding SALT)


************************Misc..JavaScript (Wish) Copy and Paste in Address bar of IE************
javascript:function flood(n) {if (self.moveBy) {for (i = 15; i > 0;i--) {for (j = n; j > 0; j--){self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0);} } }} flood(6);{ var inp = " sullimac .yadhtrib yppaH ,iH"; var outp = ""; for (i = 0; i <= inp.length; i++) { outp = inp.charAt (i) + outp ; } alert(outp) ;}; reverse();


********************Asynchronous Web Services in ASP.NET 2.0****************************
http://www.dotnetbips.com/articles/displayarticle.aspx?id=519

**************************ASP.NET Resource********************************
http://www.tanguay.info/web/codeExample.php5?id=512
http://www.i-sources.net/?view=blog&blog_id=355647310
http://www.syncfusion.com/faq/aspnet/default.aspx

*********************Highlighting Search Keywords in a Data Grid Web Control****************
http://aspnet.4guysfromrolla.com/articles/072402-1.aspx

************************Create folder in Server/dynamically***********************************
http://www.devhood.com/messages/message_view-2.aspx?thread_id=106332



*************************Dynamic drill-down DataGrid************************************
http://searchvb.techtarget.com/tip/0,289483,sid8_gci833650,00.html
http://www.howtodothings.com/computers/a1495-multi-level-datagrid.html (Multi Level DataGrid)



******************************Hiding Datagrid Columns*********************************
http://www.gridviewguy.com/ArticleDetails.aspx?articleID=30


*************Add Column Dynamically to DataGrid to Display Calculation*********************
http://www.c-sharpcorner.com/Code/2003/May/AddingDataGridColumnToCal.asp





****************Timers in ASP.NET***************************************************
http://www.asp101.com/samples/time_aspx.asp
http://dotnetjunkies.com/Forums/ShowPost.aspx?PostID=5060
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=69a7c7bb-939a-4777-aceb-2d9ebbe35b85
http://samples.gotdotnet.com/quickstart/howto/doc/Timer.aspx
http://blogs.msdn.com/mswanson/


********************************Slideshow Demo in Data list******************************
http://aspnet.4guysfromrolla.com/articles/070704-1.aspx


************************Data grid with sub columns********************************************
http://www.eggheadcafe.com/articles/pfc/aspnet_scrollable_table_server_control.asp


**************************Build a Nested Grid View Control with ASP.NET*********************
http://www.codeguru.com/columns/vb/article.php/c12647/


********************************Creating a Single Sign-on across ASP.NET Application**********
http://www.wwwcoder.com/main/parentid/258/site/2598/68/default.aspx


***********************************Export ASP.NET DataGrid to Excel**********************
http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp


****************** File Uploading to Server Hard Disk using ASP.NET**************************
http://stardeveloper.com/articles/display.html?article=2003022601&page=3
http://stardeveloper.com/articles/display.html?article=2003022601&page=1


****Gracefully Responding to Unhandled Exceptions - Processing Unhandled Exceptions**************
http://aspnet.4guysfromrolla.com/articles/091306-1.aspx



*****************************free web mail****************************************************************************
http://www.iisworks.com/webmail/


********************************tool tips to ASP.Net DataGrid Headers*********************************

http://www.netomatix.com/GridToolTip.aspx
http://gridviewguy.com/ArticleDetails.aspx?articleID=80

*********************MSDN FOR VISUAL STUDIO 2005(ADO.NET 2.0)** *******************
http://msdn2.microsoft.com/en-us/library/tat996zc(VS.80).aspx

**************Sending Dataset across .net remoting**************************************************
http://www.akadia.com/services/dotnet_dataset_remoting.html




*************************System.Runtime.Remoting.Channels*********************************
http://www.123aspx.com/Rotor/default.aspx?n=System.Runtime.Remoting.Channels
http://www-adele.imag.fr/users/Didier.Donsez/ujf/GICOM/GICOM_ENS/exemples/dotnet/RemotingDesignDecisions.asp.htm

*********************real world example of 'chat and file send' application*****************************
http://www.codeproject.com/useritems/Net_Remoting_Events.asp




*********ASP.NET Web Application and Windows Authentication – a Case Study**************


http://www.codeproject.com/useritems/WindowsSecuritynASPNet.asp

*********************SDLC Checklist for Globalized ASP.Net Web Applications.********************

http://www.codeproject.com/useritems/Globalized_ASPNet_WebApp.asp


******************************Creating an FTP Client in .NET**************************************************
http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm


**********************Collection************************
ftp://194.44.214.3/pub/music/!incoming_write_disabled/Music/B/

*******************************.NET Remoting – Basic Maneuvers**********
http://www.codeproject.com/csharp/dotnetremotingbasictutor.asp?df=100&forumid=24233&exp=0&select=1089540



****************************Movies,Softwares,Mobile, ALL*************************************
http://www.freizeit.co.in/index.php


**********************************Tamil Movies******************************************************
www.ictboss.com
www.tamilmatrix.com


*******************************englishsongs download************************************
www.emp3s.com
www.kageworld.tk

**********************************Collection of all sites for .Net************************************
http://www.dotneturls.com/

JavaScript Validation

JavaScript History
• Java was born as “LiveScript” at the beginning of the
94’s.
• Name changed into JavaScript (name owned by
Netscape)
• Microsoft responds with Vbscript
• Microsoft introduces JScript (dialect of Javascript)
• A standard is defined: ECMAScript (ECMA-262,
ISO-16262)
2
2
J0
3
JavaScript Myths
JavaScript is NOT simple
Simple tasks are indeed simple
JavaScript is NOT Java
Graphics YES Partial
Networking YES NO
Browser Control NO YES
Java JavaScript
J0
4
JavaScript is…
Scripted (not compiled)
Powerful
Object-based
Cross-Platform
Client and Server
3
3
J0
5
JavaScript allows…
DynamicWeb Sites
Dynamic HTML (DHTML)
Interactive Pages/Forms
Server-Side CGI Functionality
Application Development
J0
6
JavaScript can…
Build Objects
Use Events
Enforce Security
Embed or Componentize
4
4
J0
7
Base
• Syntax is C-like (C++-like, Java-like)
case-sensitive,
statements end with (optional) semicolon ;
//comment /*comment*/
operators (=,*,+,++,+=,!=,==,&&,…)
• Basic data types
integer, floating point, strings (more later)
• Loosely typed variables (Basic-like) var x=3;
Core Core
J0
8
Statements
• if (expression) {statements} else {statements}
• switch (expression) {
case value: statements; break;

default: statements; break;
}
• while (expression) {statements}
• do (expression) while {statements}
• for (initialize ; test ; increment) {statements}
Core Core
5
5
J0
9

10
Strings
a=“foo”; b=‘tball’

indexOf(substring), lastIndexOf(substring)
charCodeAt(n),fromCharCode(value,…)
concat(value,…),slice(start,end)
toLowerCase(), toUpperCase()
replace(regexp,string), search(regexp)
Core Core
6
6
J0
11
Strings
a=“foo”;
TAG-related methods:
a.bold() => foo
big(), blink(), fontcolor(), fontsize(), small(),
strike(), sup()
anchor(),link()
Core Core
J0
12
Functions
function f(x) {return x*x}
_____________________________________________
function add(x,y) {return x+y};
function multiply(x,y) {return x*y};
function operate(op,x,y) {return op(x,y)};
operate(add,3,2); => 5
Core Core



Objects
Object: A data structure with methods;
a special method is the “constructor”.
function Rectangle(w, h) {
this.width=w;
this.height=h;
this.area=function(){return this.width*this.height}
}
a=new Rectangle(3,4); a.area() => 12 a.width => 3
Instance variables
method
Core Core
9
9
J0
17
Objects
Actually, JavaScript does NOT have classes and inheritance.
Moreover, the approach we have shown is not the most
efficient in terms of memory allocation.
It would be better to use the “prototype” feature, which can
be consideres a STATIC object
Rectangle.prototype.area=function(){return this.w*this.h}
Core Core
J0
18
Arrays
a = new Array()
a[0]=3; a[1]=“hello”; a[10]=new Rectangle(2,2);
a.length() => 11
Arrays can be
SPARSE, INHOMOGENEOUS , ASSOCIATIVE
a[“name”]=“Jaric”
z=new Rectangle(3,4); z[“width”] z.width
Core Core
10
10
J0
19
Object hierarchy
DOM DOM
frames[] history
anchors[] applets[] embeds[]
Button Checkbox Form Hidden
Input Password Radio Reset
Select Submit Text Textarea
elements[]
forms[] links[] plugins[] images[]
document location navigator screen parent top
Window
The Most
Important Slide
Symbol means containment (has-a)
Dashed line means “is an instance of”
J0
20
Window
Other properties
status – defaultStatus
name
Main properties
Objects
history
frames[]
document
location
navigator
screen
parent – top
“A web browser window or frame”
DOM DOM
11
11
J0
21
Window
Main methods
alert(), prompt(), confirm()
focus(), blur()
moveBy(), moveTo()
resizeBy(), resizeTo()
scroll(), scrollBy(), scrollTo()
setInterval(), clearInterval()
setTimeout(), clearTimeout()
DOM DOM
J0
22
Screen
Main properties
availHeight, availWidth
height, width
colorDepth, pixelDepth
hash
“Information about the display”
DOM DOM
12
12
J0
23
Navigator
Main methods
javaEnabled()
Other properties
Info on available plugins, but only in Netscape
Navigator!
Main properties
appName
appVersion
Platform
“Information about the browser in use”
DOM DOM
J0
24
History
Main methods
back()
forward()
go(+/-n)
go(target_substring)
Main properties
lenght
“The URL history of the browser”
DOM DOM
13
13
J0
25
Location
Main methods
reload()
replace()
Main properties
href
protocol, hostname, port
search
hash
“The specification of the current URL”
DOM DOM
J0
26
Document
Main methods
open()
close()
clear()
write()
Other properties
bgColor, fgColor, linkColor, vlinkColor
lastModified
title, URL, referrer, cookie
Main properties
Arrays of Component Objects
anchors[]
applets[]
embeds[]
forms[]
links[]
plugins[]
“An HTML document”
DOM DOM
14
14
J0
27
Image
Main properties
border [width in pixels]
height
width
src [URL of the image to be displayed]
“An image embedded in an HTML document”
DOM DOM
J0
28
Events
Document, Image, Link,
Text elements
onKeyPress KeyDown+KeyUp (*)
Document, Image, Link,
Text elements
onKeyUp User releases key
Document, Image, Link,
Text elements
onKeyDown User presses key (*)
onMouseOut Mouse moves off element Link, Image, Layer
onMouseOver Mouse moves over element Link, Image, Layer
Document, Image, Link,
button
onMouseUp User releases mouse button (*)
Document, Image, Link,
button
onMouseDow User presses mouse button (*)
n
Document, Image, Link,
button
onDblClick User clicks twice
onClick User clicks once. (*) Link, button
(*) Return false to cancel default action
DOM DOM
15
15
J0
29
Events
onResize Window is resized Window
onSubmit Form submission requested(*) Form
onReset Form reset requested (*) Form
onUnload Document is unloaded Window
Document or image finishes Window, Image
loading
onLoad
onAbort Loading interrupted Image
onError Error while loading image Image
User selects/deselects a text Select, text input elements
and moves focus away
onChange
TextElement, Window, all
form elements
onBlur Element loses focus
TextElement, Window, all
form elements
onFocus Element gains focus
(*) Return false to cancel default action
DOM DOM
J0
30
Input
Hidden X X X X
Select X X X X X X X X X X X X
FileUpload X X X X X X X X X X X
Password X X X X X X X X X X X
Textarea X X X X X X X X X X X
Text X X X X X X X X X X X
Submit X X X X X X X X X X
Reset X X X X X X X X X X
Radio X X X X X X X X X X X X
Checkbox X X X X X X X X X X X X
Button X X X X X X X X X X
defaultChecked
checked
defaultValue
form
length
name
options[] selectedIndex
type value
blur()
click()
focus()
select()
onblur
onchange
onclick
onfocus
Methods
Event
Handlers
Properties
Properties
Objects
DOM DOM
16
16
J0
31
Form
Main properties
action [destination URL]
method [get/post]
name [name of Form]
name [destination Window]
Elements[] [list ;of contained elements]
Main methods
reset()
submit()
“An HTML input form”
DOM DOM
J0
32



A more complex example -3
function isEmpty(s)
{ return ((s == null) || (s.length == 0))
}
function warnEmpty (theField, s)
{
var mPrefix = "You did not enter a value into the ";
var mSuffix = " field. This is a required field. Please enter it now.";
theField.focus();
alert(mPrefix + s + mSuffix);
return false;
}
Check that the string
“s” is not empty
Issue a warning
message
All this is contained in the file “FormCheck.js”
19
19
J0
37
A more complex example -4
function promptEntry (s)
{ window.status = "Please enter a " + s;
}
function validatePersonalInfo(form)
{ return (
checkString(form.elements["LastName"],sLastName)
)
}
function checkString (theField, s)
{
if (isEmpty(theField.value)) return warnEmpty (theField, s);
else return true;
}
Type a message in the status bar
Check that “theField”
is not empty
Validate the form
(should run over all fields
And perform suitable checks)
All this is contained in the file “FormCheck.js”
J0
38



Applet
Methods
Same as the public methods
of the Java applet
Properties
Same as the public fields
of the Java applet
“An applet embedded in a Web page”
DOM DOM
J0
42
LiveConnect
A two-faced, (Netscape-only) technology to let JavaScript
interact with Java, so that:
• A JavaScript script can control and coordinate Java
applets, and let Java applets interact with plugins.
• A Java Applet can execute JavaScript code.
22
22
J0
43
Server-Side JavaScript
Not discussed here!
A substitute for CGI.
Server-dependent technology to process the
Web page before passing it to the client.
(The Netscape SSJS object model is different from the
Microsoft ASP object model, although JavaScript can
be used as SSLanguage for ASP)
See
http://developer.netscape.com/viewsource/husted_js/husted_js.html
J0
44
References
Standard ECMA-262 ECMAScript Language Specification:
http://www.ecma.ch/ecma1/STAND/ECMA-262.HTM ()
Tutorials and references:
• http://developer.netscape.com/tech/javascript/javascript.html
• http://www.sauronsoftware.it/jsreference
Books:
• D.Flanagan “Javascript. The definitive guide” O’Reilly.
• D.Goodman “Dynamic HTML. The definitive reference” O’Reilly
23
23
J0
45
Java-JavaScript interaction: JSObject
JSObject allows Java to manipulate objects that are defined in JavaScript.
Values passed from Java to JavaScript are converted as follows:
JSObject is converted to the original JavaScript object.
Any other Java object is converted to a JavaScript wrapper, which can be
used to access methods and fields of the Java object.
Converting this wrapper to a string will call the toString method on the
original object, converting to a number will call the floatValue method if
possible and fail otherwise.
Converting to a boolean will try to call the booleanValue method in the
same way.
Java arrays are wrapped with a JavaScript object that understands
array.length and array[index].
A Java boolean is converted to a JavaScript boolean.
Java byte, char, short, int, long, float, and double are converted to
JavaScript numbers.
Note If you call a Java method from JavaScript, this conversion happens
automatically--you can pass in "int" argument and it works.
J0
46
Java-JavaScript interaction: JSObject
Values passed from JavaScript to Java are converted as follows:
Objects that are wrappers around Java objects are unwrapped.
Other objects are wrapped with a JSObject.
Strings, numbers, and booleans are converted to String, Float, and
Boolean objects respectively.
Examples
(String) window.getMember("name")
(JSObject) window.getMember("document")
24
24
J0
47
Java-JavaScript interaction: JSObject
The netscape.javascript.JSObject class has the following methods:
Method Description
Call Calls a JavaScript method
Eval Evaluates a JavaScript expression
getMember Retrieves a named member of a JavaScript object
getSlot Retrieves an indexed member of a JavaScript object
removeMember Removes a named member of a JavaScript object
setMember Sets a named member of a JavaScript object
setSlot Sets an indexed member of a JavaScript object
toString Converts a JSObject to a string
The netscape.javascript.JSObject class has the following static methods:
getWindow Gets a JSObject for the window containing the given applet
J0
48
Java-JavaScript interaction: applet
side
package javascript;
import netscape.javascript.*;
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet {
private JSObject mainWindow;
private JSObject pageDoc;
private JSObject location;
private String s;
public String comment="instanceVarContent";
public void init() {
System.out.println("initing");
mainWindow = JSObject.getWindow(this);
pageDoc = (JSObject) mainWindow.getMember("document");
location = (JSObject) mainWindow.getMember("location");
s = (String) location.getMember("href"); // document.location.href
}
25
25
J0
49
Java-JavaScript interaction: applet
side
public int r=0;
public int g=255;
public int b=0;
public void start(){
s=(String)mainWindow.call("f",null);
String[] stringArgs = new String[1];
stringArgs[0] = "5";
s=(String)mainWindow.call("g", stringArgs);
System.out.println (" Calling g returned "+s);
}
public void paint(Graphics gra) {
if (s==null) s="NULL";
gra.setColor(new Color(r,g,b));
Dimension d=this.getSize();
gra.fillRect(0,0,d.width,d.height);
gra.setColor(new Color(0,0,0));
gra.drawString("VERSION 1",80,80);
gra.drawString(s,30,30);
}
J0
50
Java-JavaScript interaction: applet
side
void changeColor(String s) {
int x=Integer.parseInt(s);
r=x;
this.repaint();
}
public String square(String sx) {
int x=Integer.parseInt(sx);
return new Integer(x*x).toString();
}
}
26
26
J0
51