473,400 Members | 2,163 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,400 software developers and data experts.

Accessing ViewState from image rendering aspx page

I have an aspx page that saves some information using the ViewState. This
page has an IMG META that uses a second aspx page to render the image.

<IMG src= "ImageRender.aspx">

I noticed that in the ImageRender.aspx, the "sender" parameter in the
Page_Load referes to the page that has the IMG tag.

The main page saves State information using the ViewState. Can this
information be accessed from the ImageRender.aspx?
Thanks

Jeronimo
Nov 18 '05 #1
8 1886
The viewState is a private property of the Page object. However, you
can create a public property in the main page that access the
viewState. In your "ImageRender.aspx", you can access the viewState of
the main page through the public property.

Tommy,

Jeronimo Bertran <je******@bertran.com> wrote in message news:<Xn********************************@207.46.24 8.16>...
I have an aspx page that saves some information using the ViewState. This
page has an IMG META that uses a second aspx page to render the image.

<IMG src= "ImageRender.aspx">

I noticed that in the ImageRender.aspx, the "sender" parameter in the
Page_Load referes to the page that has the IMG tag.

The main page saves State information using the ViewState. Can this
information be accessed from the ImageRender.aspx?
Thanks

Jeronimo

Nov 18 '05 #2
Tommy

I created the public property but I still don't understand how to reference
the main page from the ImageRender.aspx.

Thanks again
The viewState is a private property of the Page object. However, you
can create a public property in the main page that access the
viewState. In your "ImageRender.aspx", you can access the viewState of
the main page through the public property.

Tommy,

Jeronimo Bertran <je******@bertran.com> wrote in message
news:<Xn********************************@207.46.24 8.16>...
I have an aspx page that saves some information using the ViewState.
This page has an IMG META that uses a second aspx page to render the
image.

<IMG src= "ImageRender.aspx">

I noticed that in the ImageRender.aspx, the "sender" parameter in
the Page_Load referes to the page that has the IMG tag.

The main page saves State information using the ViewState. Can this
information be accessed from the ImageRender.aspx?
Thanks

Jeronimo


Nov 18 '05 #3
Hi Jeronimo,

Based on my research and experience, the following article is useful to
you. Please refer to it carefully.

http://msdn.microsoft.com/library/de...us/vbcon/html/
vbtskpassingvaluesbetweenwebformspages.asp
Passing Values Between Web Forms Pages
"...
There are many times when you will want to navigate from one page to
another and pass values from the first page to the second..."

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #4
Hi Jacob,

I read the article and it definately helps, however it talks about
invoking the second page using Server.Transfer("Webform2.aspx");
In my case, the second page is the src of an IMG tag...
<IMG src="Webform2.aspx">
I tried the following in the Webform2 but the assignment fails:
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
WebForm1 sourcepage = (WebForm1) Context.Handler;
}
}

Thanks again,

Jeronimo

ji***@online.microsoft.com (Jacob Yang [MSFT]) wrote in
news:3U**************@cpmsftngxa06.phx.gbl:
Hi Jeronimo,

Based on my research and experience, the following article is useful
to you. Please refer to it carefully.

http://msdn.microsoft.com/library/de...y/en-us/vbcon/
html/ vbtskpassingvaluesbetweenwebformspages.asp
Passing Values Between Web Forms Pages
"...
There are many times when you will want to navigate from one page to
another and pass values from the first page to the second..."

Does it answer your question? If I have misunderstood your concern,
please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no
rights.


Nov 18 '05 #5
Hi Jeronimo

Based on my research and experience, I would like to share the following
information with you.

When the first page is requested, the server only sends the tag for the
image, not the image itself. The browser sees the image tag and makes an
independent request for the image. Then the server receives the request for
the image, it does not know about the previous page request unless you
store information in the session object or in the image tag's query string.

We have run a test to see what the "sender" object contains in the page
that provides the image. It contained it's own page object, not the calling
page's object. Therefore, the sender object does not help.

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #6
Hi Jeronimo

Based on my research and experience, I would like to share the following
information with you.

When the first page is requested, the server only sends the tag for the
image, not the image itself. The browser sees the image tag and makes an
independent request for the image. Then the server receives the request for
the image, it does not know about the previous page request unless you
store information in the session object or in the image tag's query string.

We have run a test to see what the "sender" object contains in the page
that provides the image. It contained it's own page object, not the calling
page's object. Therefore, the sender object does not help.

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #7
Jacob,

Thanks again... ok, everything is clear.

Nov 18 '05 #8
Jacob,

Thanks again... ok, everything is clear.

Nov 18 '05 #9

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

Similar topics

11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
3
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
4
by: Ersin Gençtürk | last post by:
Server : WEB System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Web.HttpException: The View State is invalid for this page and might be...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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,...
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.