asp.net - ClientID invalid after moving code into DotNetNuke module -


I've discovered I'm porting an existing application to a DotNetNuke module and bizarre behavior. I use ClientId while creating JavaScript so that code can recognize HTML elements. Usually that makes something like this a price: it's a million times

  "g_ctl00_ctl01_ctl00_ctl00_txtSearch"  

We've all seen, right ? Well, after this code porting to a DotNetNuke module and run it for the first time, ClientID property is this return:

  "dnn_ctr397_GalleryServerPro.Web.Gallery, TechInfoSystems_ctl00_ctl01_ctl00_ctl00_txtSearch"  

Note the comma and space. For example, ASP.NET login control is now outputting illegal JavaScript:

This is causing all kinds of JavaScript errors. Dokyumentkal [ "Dnn_ktr397_gllerisserverprokvebkgalri, Tecinfosystems_ktl00_ktl0l_ktl0l_lv_ktl02_loginl_ussernamerekuired"]: Dokyumentkgetelementbyid ( "Dnn_ktr397_gllerisserverprokvebkgalri, Tecinfosystems_ktl00_ktl0l_ktl0l_lv_ktl02_loginl_ussernamerekuired");

is an assembly name TechInfoSystems.GalleryServerPro.dll my module, the default namespace GalleryServerPro.Web, and user control Gallery.cs is called square, partly explains that Where is some of that extra lesson coming, but why is there? And can I make sure that ClientID produces commas, spaces, or other characters that can not cause problems in JavaScript?

Thanks, Roger

I was detected (sort of). I need to add an ID to user control which is being added to the dotnet net page. This is the main view user control - which handles PortalModuleBase. User controls a code-behind class (no .ascx) is perfectly located, so Init event set everything to add this:

this.ID = "GSP";

My theory is that this issue occurs when these are true:

  1. "View" User Control is the only code-behind file (any. Ascx file)

  2. The ID does not specify in user control.

when .. If you register without any modules, then anyone must specify the class and assembly module definitions In my case, this is "GalleryServerPro web gallery, TechInfoSystems Gallery ServerPro". This text looks very close to DNN, which is included in the client ID string. DNN (or ASP.NET) should take that string and use it to create client ID in the absence of id specified in user control.

Not sure that this is a DNN bug, but I'm happy to understand it and can now proceed ...


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -