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","mys cript")
'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 RegisterClientScriptBlock 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.Page just like all the *.aspx.vb files. Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/ 7 2134
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:Os**************@TK2MSFTNGP04.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 RegisterClientScriptBlock 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.'?
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
RegisterClientScriptBlock 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 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","mys cript") '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 RegisterClientScriptBlock 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.Page just like all the *.aspx.vb files. Thanks.
No, it is not.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:e4**************@TK2MSFTNGP03.phx.gbl... "Nathan Sokalski" <nj********@hotmail.com> wrote in message news:Os**************@TK2MSFTNGP04.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 RegisterClientScriptBlock 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.'?
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********@hotmail.com http://www.nathansokalski.com/
"Göran Andersson" <gu***@guffa.com> wrote in message
news:%2****************@TK2MSFTNGP04.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 RegisterClientScriptBlock 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 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","mys cript") '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 RegisterClientScriptBlock 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.Page just like all the *.aspx.vb files. Thanks.
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********@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP02.phx.gbl... No, it is not. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message news:e4**************@TK2MSFTNGP03.phx.gbl... "Nathan Sokalski" <nj********@hotmail.com> wrote in message news:Os**************@TK2MSFTNGP04.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 RegisterClientScriptBlock 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.'?
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********@hotmail.com http://www.nathansokalski.com/
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:uw**************@TK2MSFTNGP03.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********@hotmail.com> wrote in message news:Ok**************@TK2MSFTNGP02.phx.gbl... No, it is not. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message news:e4**************@TK2MSFTNGP03.phx.gbl... "Nathan Sokalski" <nj********@hotmail.com> wrote in message news:Os**************@TK2MSFTNGP04.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 RegisterClientScriptBlock 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.'?
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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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"...
|
by: Roy |
last post by:
The following code - straight out of the MSDN help - uses ASP.NET 2.0's
Client Callback features, and yet, ALWAYS postback to the page.
Why? I expected no postbacks to occur.
<%@ Page...
|
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...
|
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...
|
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:
...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |