Skip Navigation LinksHome > Categories > Code from a Category

Developing Facebook Application with .NET Submitting Form Information, Adding Client-side Validation and Using FBJS Dialogs



User Name: tippu
Name: King SheZ
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
7 years of enterprise application development, so far in my career i have worked on enterprise web applications with millions of users,i have also worked on many integrations between applications, i h... [More]
Viewed Times: 4011
Add Date: 07/19/2011
Continuing from my last post, i will explain in my this article about Developing Facebook Application with .NET Submitting Form Information, Adding Client-side Validation and Using FBJS Dialogs. for better understanding kindly go through my previous posts.

So, at this point we have a nice-looking form that presents a list of items and allows the user to select a Friend... but it would be nice if the application could pass that information back to us, yeah? Do you remember the server-side button buttonSend I had:





When the user clicks on this button, the page supposed to a) check user input, i.e. if a Friend is entered and b) submit the information back. Let's check user input when the form is about to be submitted. On the ASPX page, I added JavaScript (FBJS):



]]>

...and in the code:









If input passes the validation check (in this example, we only check if the user selects/enters a Friend), then the page is submitted and we have a chance to save selected data into the database. Hooray!





* Notice the reference to the Page.Request.Form["textSelectedFriend"] form field from the element. No, we didn't create this element on the page. Instead, the Facebook platform added it "dynamically." You can also use other types of Dialogs, for example, DIALOG_CONTEXTUAL:





To display such s CONTEXTUAL dialog, we can use "inline" JavaScript (FBJS):





...or, to display a POPUP:





Angela
Comment #:  71 Replay this Comment Reply this comment Posted on: 6/4/2012

 Wow this site is really great and amazing to me, i am impressed by this site.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.