Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 21st, 2011, 01:22 AM
Authorized User
 
Join Date: Jan 2011
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default Page_IsValid Problem

Hi guys,

I am trying to implement the exact same code that Imar implemented in the book. Besides the point where he implemented it in a user control, I am implementing it directly in the Contact Us page.

Here is my code.

Code:
$(function ()
        {
            $.watermark.options = {
                className: 'fontSize',
                useNative: false
            }
            $('#<%= fullNameTextBox.ClientID%>').watermark('Enter your full name...');
            $('#<%= emailTextBox.ClientID%>').watermark('Enter your email address...');
            $('#<%= contactNoTextBox.ClientID%>').watermark('Contact No...Eg: 610-931-1281');
            $('#<%= commentTextBox.ClientID%>').watermark('Enter your comment...');

            $('form').bind('click', function ()
            {
                if (Page_IsValid)
                {
                    $('#ContactFormDiv').slideUp('3000');
                }
            });

        });
I am using a different watermark plugin. This one can be found at . It is extremely easy to use.

The problem I am having is that the Page_IsValid doesn't seem to be recognized. When I comment it out, the code works. In case you are wondering, I have the ScriptManager in the master page.

Can anyone tell me what I'm doing wrong?

Thank you.
 
Old December 21st, 2011, 02:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Page_IsValid comes from the client side validation framework. Does your page contain standard asp.net validators?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 21st, 2011, 11:43 AM
Authorized User
 
Join Date: Jan 2011
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, I am using the standard ASP.net validation controls. If you want I could provide the code for the entire page.
 
Old December 21st, 2011, 12:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, that would be helpful. Please create a page with just a minimal implementation to reproduce the problem (e.g. no master page, base page, database dependencies and so on). Also, please supply a link (or the script) for the plugin. Then I can try to reproduce the problem.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 22nd, 2011, 03:57 PM
Authorized User
 
Join Date: Jan 2011
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar,

Thank you again. I think its the order in which I put the reference links in the master page. I put the jQuery reference above all other references and its now working. Also when I tried it, I hadn't included any logic in the code behind of the page.

The question now though is, what does the ScriptManager render as? How does it fit in ehn talking about script references?

Thanks always.

PS: Here is the link for the watermark I used.
http://code.google.com/p/jquery-watermark/
 
Old December 23rd, 2011, 03:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The ScriptManager mainly lives on the server. What it does is dynamically include JavaScript files for client side behavior. Check out the final HTML of a page in the browser and you'll see what I mean: you'll see a number of <script /> elements with their source set to a long and cryptic file name. Some of those have been added by the ScriptManager to support behavior for stuff like the UpdatePanel and client side web service calls.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.