473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

"Page.Clientscript" does not compile in assembly,

"Page.Clientscript" does not compile in assembly, with the error message "Reference to a non-shared member requires an object
reference". ...

what reference is it looking for ??????
class class1
public sub showimg()
Dim Response As HttpResponse = HttpContext.Current.Response
Dim theImage As New object
theImage.ImageUrl = Page.ClientScript.RegisterStartupScript.GetWebReso urceUrl(Me.GetType(), "img.gif")
response.write( "<img src=""" & theImage & """>")
end sub
end class

Sep 10 '06 #1
4 3294
Jon Paal wrote:
"Page.Clientscript" does not compile in assembly, with the error
message "Reference to a non-shared member requires an object
reference". ...
what reference is it looking for ??????
class class1
public sub showimg()
Dim Response As HttpResponse = HttpContext.Current.Response
Dim theImage As New object
theImage.ImageUrl =
Page.ClientScript.RegisterStartupScript.GetWebReso urceUrl(Me.GetType(),
"img.gif") response.write( "<img src=""" & theImage & """>") end sub
end class
Replace
theImage.ImageUrl =
Page.ClientScript.RegisterStartupScript.GetWebReso urceUrl(Me.GetType(),
"img.gif")
with
theImage.ImageUrl = Page.ClientScript.RegisterStartupScript(Me.GetType (),
"img.gif")

RegisterStartupScript is a function, not a property.

--

Riki
Sep 10 '06 #2
I still get the same error message ...

class class1
public sub showimg()
Dim Response As HttpResponse = HttpContext.Current.Response
Dim theImage As New object
theImage.ImageUrl = Page.ClientScript.RegisterStartupScript(Me.GetType (), "img.gif")
response.write( "<img src=""" & theImage & """>")
end sub
end class
Sep 10 '06 #3
"Page.Clientscript" does not compile in assembly, with the error message
"Reference to a non-shared member requires an object reference". ...

what reference is it looking for ??????

class class1
public sub showimg()
Dim Response As HttpResponse = HttpContext.Current.Response
Dim theImage As New object
theImage.ImageUrl =
Page.ClientScript.RegisterStartupScript.GetWebReso urceUrl(Me.GetType(),
"img.gif")
response.write( "<img src=""" & theImage & """>")
end sub
end class
Apparently this code is not in an aspx/ascx codebehind, but in an
"external" class. "Page" is not some system-wide global variable, but a
property of the Control class. That is why you can use it there, but
not here. You need to pass a reference to your page to this function.

public sub showimg(MyPage as System.Web.UI.Page)
....
theImage.ImageUrl = MyPage.Register....

Remark 2: I don't know VB that well, but if you declare "theImage" as a
plain "object", does it recognise properties like "ImageUrl" (which is
not a property of "object")?

Remark 3: I'm not sure the line "<img src=""" & theImage & """>" will
give the required result. Why not directly put the URL you get from the
WebResource here?

Hans Kesting
Sep 11 '06 #4
Apparently this code is not in an aspx/ascx codebehind, but in an "external" class.

yes this is an assembly class

"Page" is not some system-wide global variable,..

I inherited the page class and now it compiles
Remark 2: I don't know VB that well, but if you declare "theImage" as a plain "object", does it recognise properties like
"ImageUrl" (which is not a property of "object")?
not sure ...

>
Remark 3: I'm not sure the line "<img src=""" & theImage & """>" will give the required result. Why not directly put the URL you
get from the WebResource here?

I don't know the url of the image as it is stored in the assembly with a unique identifier url

Sep 11 '06 #5

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

Similar topics

2
by: Stephen Ferg | last post by:
There are a couple of broken links on the Python Eggs site: http://www.python-eggs.org/links.html I'd like to reach the maintainer and report them, but there's no information about the...
0
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
1
by: digitalego | last post by:
Sorry if the title is a little confusing... Here is the problem. I am working with a "default.aspx" page that uses a user control I made: ------------------------------ | default.aspx ...
2
by: dana lees | last post by:
Hi, I am developing a c# asp.net application. I have a button which when i click on i open a pdf file. Since the pdf file is very very large i would like to open a window that says "Loading...
2
by: Monty | last post by:
Hello, I have a label control in my master page like this: <asp:Label ID=lblStatusMessage runat="server"></asp:Label> When I reference the control in my code-behind I get this error "Name...
1
by: epatrick | last post by:
I have a series of custom controls developed under ASP.NET 1.1, and I've successfully migrated to ASP.NET 2.0. I have also developed a custom class dervied from System.Web.UI.Page, called...
4
by: sid | last post by:
Can someone tell me how to detect "Action Cancelled" page with out polling. I have a frame set and I want to make sure the other frame is displaying what it is supposed to without polling. For...
4
by: lander | last post by:
I've read the page life cycle thing in msdn, still, i'm getting a bit confused of thinking how all the things are going under the hood... I know that when page loading, that the controls'...
4
by: evenlater | last post by:
Anybody know how to prevent the annoying Access 2007 "Getting Started with Access" page from showing up when the database is closed using DoCmd.Quit? My database is used in a terminal server...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.