Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHelp!!! *DNN Rookie*Help!!! *DNN Rookie*
Previous
 
Next
New Post
3/14/2007 4:38 PM
 
 

Hello,

I'm  new in this forum and I'm just starting to know DNN. I have some problems validating controls, client side, for example  a textbox. Would somebody please explain recomended control validation techniques to use with DNN or give me some examples or links pls.

I have another problem, i would like to know how to register a .js file, using c#, for my module so i can validate my controls client side.

Thanks in advance!!!

 
New Post
3/15/2007 11:08 AM
 
The schemes used for validation and js file registration are not different than normal ASP.NET.  (Validator Controls can be used and you register scripts either through the Page.RegisterXXX methods for 1.x or Page.ScriptManager.RegisterXXX methods for 2.x). 

 
New Post
3/15/2007 1:22 PM
 
Thanks for your unswer,

    I actually tried validators, but i coudn't make them work with FireFox so i choosed to make the control validations with javascript, for that i created a file MyModule.js containing the validation function now i would like to add a reference for that file only once, by code, in the html no matter how many instances of my module the user add the page. So i did something like this:

                if (!IsPostBack)
                {          
                    if( ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML))
                    {
                        if (!ClientAPI.IsClientScriptBlockRegistered(this.Page, "MyModule.js"))
                        {
                            ClientAPI.RegisterClientScriptBlock(this.Page, "MyModule.js", "what goes here?"); <--- this actually doest work.
                        }
                    }

Please could you give me an example on how to add a reference to a .js file on my html using the Client API? becouse i coudnt make it work and i didnt see any summarys at all.

Thanks!!!
 
New Post
3/15/2007 6:53 PM
 

Like I mentioned earlier, you don't need to use anything with the ClientAPI.  This is just standard ASP.NET.  As for examples, there are many of them on the web.  Here is one.  As far as determining if the script is registered, this is a standard ASP.NET method as well (IsClientScriptBlockRegistered).

 


 
New Post
3/16/2007 10:06 AM
 
Im sorry but im afraid that it didnt work, i was able to resolve it the following way:

if(!IsPostBack)
{
    string path = this.Page.ResolveUrl("DesktopModules/BibliotecaBusqueda/BibliotecaBusqueda.js");
    string sp = "<script type=\"text/javascript\" src=\"" + path + "\"></script>";
    ClientAPI.RegisterClientScriptBlock(this.Page, "sdBibliotecaBusqueda.js", sp);
}

Ofcourse... i had to use the ClientAPI becouse the Page.RegisterClientScriptBlock doesnt work.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHelp!!! *DNN Rookie*Help!!! *DNN Rookie*


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out