473,788 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where is Page.RegisterCl ientScriptBlock Available?

I have used the RegisterClientS criptBlock method in external functions of
mine (ones that are saved in a separate *.vb file), where I use them as
follows:

Public Shared Sub MyFunction(ByVa l txtbox As TextBox)
'other code
txtbox.Page.Reg isterClientScri ptBlock("mykey" ,"myscript")
'other code
End Sub

When I use this external function in my *.aspx.vb files, it does what I want
and expect. However, when I try to use the RegisterClientS criptBlock in my
*.aspx.vb files, it is not included in the list of methods, properties, etc.
when I type 'Page.' Why is Visual Basic not listing this method with the
others while I am writing my code? The *.aspx.vb file inherits
System.Web.UI.P age just like all the *.aspx.vb files. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Jun 10 '06 #1
9 1393
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Os******** ******@TK2MSFTN GP04.phx.gbl...
When I use this external function in my *.aspx.vb files, it does what I
want and expect. However, when I try to use the RegisterClientS criptBlock
in my *.aspx.vb files, it is not included in the list of methods,
properties, etc. when I type 'Page.'


Is it available when you type 'Me.'?
Jun 10 '06 #2
You need a reference to the actual Page object for the page that is
created as a response to the request.

In the example you show, that is accomplished by the fact that the
control that you are passing to the method contains a reference to the
page that it has been added to.

Inheriting the Page class would give you access to the
RegisterClientS criptBlock method, but that doesn't help you a bit. You
need a reference to the page that is being created, not just any Page
object.

Nathan Sokalski wrote:
I have used the RegisterClientS criptBlock method in external functions of
mine (ones that are saved in a separate *.vb file), where I use them as
follows:

Public Shared Sub MyFunction(ByVa l txtbox As TextBox)
'other code
txtbox.Page.Reg isterClientScri ptBlock("mykey" ,"myscript")
'other code
End Sub

When I use this external function in my *.aspx.vb files, it does what I want
and expect. However, when I try to use the RegisterClientS criptBlock in my
*.aspx.vb files, it is not included in the list of methods, properties, etc.
when I type 'Page.' Why is Visual Basic not listing this method with the
others while I am writing my code? The *.aspx.vb file inherits
System.Web.UI.P age just like all the *.aspx.vb files. Thanks.

Jun 10 '06 #3
No, it is not.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Os******** ******@TK2MSFTN GP04.phx.gbl...
When I use this external function in my *.aspx.vb files, it does what I
want and expect. However, when I try to use the RegisterClientS criptBlock
in my *.aspx.vb files, it is not included in the list of methods,
properties, etc. when I type 'Page.'


Is it available when you type 'Me.'?

Jun 11 '06 #4
I realize that I need access to the Page object that is being created, but
shouldn't the keyword Me do that, as Mark Rae mentioned in one of the other
responses?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.co m> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
You need a reference to the actual Page object for the page that is
created as a response to the request.

In the example you show, that is accomplished by the fact that the control
that you are passing to the method contains a reference to the page that
it has been added to.

Inheriting the Page class would give you access to the
RegisterClientS criptBlock method, but that doesn't help you a bit. You
need a reference to the page that is being created, not just any Page
object.

Nathan Sokalski wrote:
I have used the RegisterClientS criptBlock method in external functions of
mine (ones that are saved in a separate *.vb file), where I use them as
follows:

Public Shared Sub MyFunction(ByVa l txtbox As TextBox)
'other code
txtbox.Page.Reg isterClientScri ptBlock("mykey" ,"myscript")
'other code
End Sub

When I use this external function in my *.aspx.vb files, it does what I
want and expect. However, when I try to use the RegisterClientS criptBlock
in my *.aspx.vb files, it is not included in the list of methods,
properties, etc. when I type 'Page.' Why is Visual Basic not listing this
method with the others while I am writing my code? The *.aspx.vb file
inherits System.Web.UI.P age just like all the *.aspx.vb files. Thanks.

Jun 11 '06 #5
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Ok******** ******@TK2MSFTN GP02.phx.gbl...
No, it is not.


Hmm - that's a little curious.

Indulge me - create a new web form with separate code file and see if it
works there...
Jun 11 '06 #6
I have done that. I always use a separate code-behind file (each page has a
*.aspx and *.aspx.vb file). I tried creating a new webform, and it did not
act any differently. Is it possible that there is anything in the Web.config
file or somewhere else that could be preventing me from using
RegisterClientS criptBlock? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:eN******** ******@TK2MSFTN GP04.phx.gbl...
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Ok******** ******@TK2MSFTN GP02.phx.gbl...
No, it is not.


Hmm - that's a little curious.

Indulge me - create a new web form with separate code file and see if it
works there...

Jun 12 '06 #7
in VS, check

Tools->Options->Text Editor->Basic->General

and check that "Hide advanced members" is unchecked. If it is checked, VS
will hide some methods from you.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Ok******** ******@TK2MSFTN GP02.phx.gbl...
No, it is not.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Os******** ******@TK2MSFTN GP04.phx.gbl...
When I use this external function in my *.aspx.vb files, it does what I
want and expect. However, when I try to use the
RegisterClientS criptBlock in my *.aspx.vb files, it is not included in
the list of methods, properties, etc. when I type 'Page.'


Is it available when you type 'Me.'?


Jun 12 '06 #8
THANK YOU! It might have taken me who knows how long to find that, and it is
definitely an important method in some cases. Thanks again!
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:uw******** ******@TK2MSFTN GP03.phx.gbl...
in VS, check

Tools->Options->Text Editor->Basic->General

and check that "Hide advanced members" is unchecked. If it is checked, VS
will hide some methods from you.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Ok******** ******@TK2MSFTN GP02.phx.gbl...
No, it is not.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Os******** ******@TK2MSFTN GP04.phx.gbl...

When I use this external function in my *.aspx.vb files, it does what I
want and expect. However, when I try to use the
RegisterClientS criptBlock in my *.aspx.vb files, it is not included in
the list of methods, properties, etc. when I type 'Page.'

Is it available when you type 'Me.'?



Jun 12 '06 #9
Only if the code is inside the page class. If the code is in some other
class, the Me keyword references the instance of that class.

Nathan Sokalski wrote:
I realize that I need access to the Page object that is being created, but
shouldn't the keyword Me do that, as Mark Rae mentioned in one of the other
responses?

Jun 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8506
by: Mike P | last post by:
Is there a difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript? I've seen them both in code examples and they both seem to be doing the same thing. Any help would be really appreciated. Cheers, Mike
10
2487
by: MS News | last post by:
Hello, Where can I find RegisterClientScriptBlock() Page class does not have it. Do I have to Import or add some special reference?? what about RegisterScript which I can see but can not do anything with it
2
1993
by: Earl Teigrob | last post by:
I have a Web Custom Control that builds javascript to write to the page. The DatePickerJs() function builds over 500 lines of javacript code. Even thought my Custom Web Control does not write it to the client, it regenerates the string very time this control appears on a page. Is there a way to create this string ONCE and then just use if every time after that? CODE
3
2604
by: Arun K | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary in the bulleted list on top. I have 3 text boxes, and two RadioButtonList. and 3 buttons. One for Submit, Reset and Exit. If submit is pressed page should be validated and submit (insert into
0
1242
by: Ken Baltrinic | last post by:
I am authoring a composite server control (inheriting from System.Web.UI.Control) that uses a good chunk of client side javascript. To make this work I need to call RegisterArrayDeclaration and in a manner simmilar to the following: Page.RegisterArrayDeclaration( dataObjectArrayName, string.Format( "{{ spanID:'{0}', calendarID:'{1}' }}", spanID,
2
4612
by: Andrew | last post by:
Hi, I have written this code, but I have received an error message for the javascript code. This is written in the html of the page. <a href="default.aspx" id="NoAccessAllowed" target="_parent" type="hidden"></a> The C# code:
7
2161
by: Nathan Sokalski | last post by:
I have used the RegisterClientScriptBlock method in external functions of mine (ones that are saved in a separate *.vb file), where I use them as follows: Public Shared Sub MyFunction(ByVal txtbox As TextBox) 'other code txtbox.Page.RegisterClientScriptBlock("mykey","myscript") 'other code End Sub
2
3881
by: Keithb | last post by:
My application has several check boxes included one labeled "All" and another labeled "None." How can I incorporate javascript that will detect that the "All" or "None" checkbox was changed and then change which other check boxes are checked without making a round trip to the server? Thanks, Keith
1
1522
by: ruca | last post by:
Hi, I have a button that when clicked must print the current page after doing something in a certain function. For that I have this code: ------------------------------------------------------------------------------------------------ Private Sub ibtnPrint_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnPrint.Click Try
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.