Having questions and problems with this method.
I have a control library that embed its .gif and js, html and htc in its
ressources
Corresponding Attributes are added to the namespace using declarative
syntaxe.
My questions
1) What should be the Type parameter of RegisterClientScriptInclude if I
call it inside the PreRender method of my custom control
should it be the Page type or the Control 's one
my gif images files are correctly retrieved and display but I can't get my
script being loaded by IE clients ???
More generally I don't understand the usage of this parameters,
dovcumentation is clumsy for it.
2) my gif images files are correctly retrieved and displayed only in run
mode, but refuses to load in design mode under vs2005 ?
3) what is the type to use in declaration for htc files, should I use
text/html like this ?
[assembly: WebResource("xxx.htc", "text/html")]
Thanks for help
CS 4 1490
If you are worried about key name being unique, you can use a type specifier
to futher refine the specification. Think of it as a namespace. if two
controls requester with the same key, but different types, then they won't
override each other.
in the past, in control libraries, you often appended the type name as a
prefix to the key to solve the same problem.
-- bruce (sqlwork.com)
"WT" <WT@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl... Having questions and problems with this method. I have a control library that embed its .gif and js, html and htc in its ressources Corresponding Attributes are added to the namespace using declarative syntaxe.
My questions 1) What should be the Type parameter of RegisterClientScriptInclude if I call it inside the PreRender method of my custom control should it be the Page type or the Control 's one my gif images files are correctly retrieved and display but I can't get my script being loaded by IE clients ???
More generally I don't understand the usage of this parameters, dovcumentation is clumsy for it.
2) my gif images files are correctly retrieved and displayed only in run mode, but refuses to load in design mode under vs2005 ?
3) what is the type to use in declaration for htc files, should I use text/html like this ? [assembly: WebResource("xxx.htc", "text/html")]
Thanks for help CS
Hi,
Thank you for post!
1) I agree with Bruce on this issue: A client script include is uniquely
identified by its key and its type. Scripts with the same key and type are
considered duplicates. Only one script with a given type and key pair can
be registered with the page. So the Type parameter of
RegisterClientScriptInclude is used to further specify the identification
of the script script include. Normally you can just use the other version
which by default use the Page's type.
Regarding the issue about the script not being loaded, I think you may need
to check the name of script resource:
a) The resource name registered with [assembly: WebResource()] is
case-sensitive;
b) The resource name registered with [assembly: WebResource()] uses
project's default namespace as prefix, and includes resource folder name;
2) The gif image files are not shown in designer mode because
WebResources.axd is a http handler which requires HttpContext, and it's not
available in designer mode.
3) To include behavior in web resources, use "text/x-component":
[assembly: WebResource("xxx.htc", "text/x-component")]
Hope this helps. If there's anything unclear, please feel free to post here.
Regards,
Walter Wang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks Bruce and Walter, my problem was in the 'text/x-component' type,
where could we find list of available types for resources ?
CS
"Walter Wang [MSFT]" <wa****@online.microsoft.com> a écrit dans le message
de news: mo**************@TK2MSFTNGXA01.phx.gbl... Hi,
Thank you for post!
1) I agree with Bruce on this issue: A client script include is uniquely identified by its key and its type. Scripts with the same key and type are considered duplicates. Only one script with a given type and key pair can be registered with the page. So the Type parameter of RegisterClientScriptInclude is used to further specify the identification of the script script include. Normally you can just use the other version which by default use the Page's type.
Regarding the issue about the script not being loaded, I think you may need to check the name of script resource: a) The resource name registered with [assembly: WebResource()] is case-sensitive; b) The resource name registered with [assembly: WebResource()] uses project's default namespace as prefix, and includes resource folder name;
2) The gif image files are not shown in designer mode because WebResources.axd is a http handler which requires HttpContext, and it's not available in designer mode.
3) To include behavior in web resources, use "text/x-component": [assembly: WebResource("xxx.htc", "text/x-component")]
Hope this helps. If there's anything unclear, please feel free to post here.
Regards, Walter Wang Microsoft Online Community Support
================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
You can find MIME reference here: http://www.w3schools.com/media/media_mimeref.asp
Have a nice day!
Regards,
Walter Wang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: AMDIRT |
last post by:
I have a few questions about IssueVision (from WindowsForms) concerning its
scalability and performance. Rather, if I were to implement techniques
described here into another application, how...
|
by: Tom |
last post by:
I am new to ASP.NET. I am converting a fairly good sized app from classic
to .net. Some of my pages have a lot of controls and javascript functions.
I would like to keep these intact as much as...
|
by: Dunc |
last post by:
Hi,
I've got an ASP.NET 2.0 app, and I'm trying to incorporate Google Maps.
The app uses nested master pages, so it seems the only way to add a
<scripttag to the header block is to use...
|
by: Thomas Ploch |
last post by:
Hello fellow pythonists,
I have a question concerning posting code on this list.
I want to post source code of a module, which is a homework for
university (yes yes, I know, please read...
|
by: verci |
last post by:
Hi guys,
I'm using asp.net 2.0, can anybody send me some complete examples on using
ClientScript.RegisterClientScriptInclude and
ClientScript.RegisterClientScriptSource, for registering an...
|
by: verci |
last post by:
Hi guys,
I'm using asp.net 2.0, can anybody send me some complete examples on using
ClientScript.RegisterClientScriptInclude and
ClientScript.RegisterClientScriptSource, for registering an...
|
by: Dariusz Tomoñ |
last post by:
Hello,
I'd like to include JS from C# code (ASP.NET 2.0). I'm trying not directly
from i.e. default.aspx.cs code but from a class belonging to DLL, which is
referred in my project.
The code...
|
by: W.K. |
last post by:
Hello,
I have a question about using GNU C++ proprietary software
development, is this possible or against the GNU license? Any good
commercial cross platform complier recommendation ?
...
|
by: Dave Mathew |
last post by:
Is there any way to use RegisterClientScriptInclude to generate the
script tags inside of the <headtag?
I'm using RegisterClientScriptInclude inside of Page_Load event in the
code behind for the...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |