Saturday, March 24, 2012

Pass viewstate to a new window in asp.net 2.0

I want to pop open a new window from my asp.net 2.0 web page. I want it to
pass or submit the current viewstate to the new window. Does anyone know how
to do that? Thanks.Hi,

by using cross-page posting (PostBackUrl on buttons etc) and changing form's
target to be a new window, that's quite near . Following from my previous
post to this group

"
Hi,

one way is to change form's target when posting

<asp:Button ID="Button1" OnClientClick="form1.target='_blank'"
runat="server" Text="Button" PostBackUrl="~/Default2.aspx" /
You just might also turn it back after posting, in case other buttons still
continue posting on the same page.
"

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"lanem" <lanem@.discussions.microsoft.com> wrote in message
news:B6335CAE-75AD-4D9D-9C3A-E0962A457FDF@.microsoft.com...
>I want to pop open a new window from my asp.net 2.0 web page. I want it to
> pass or submit the current viewstate to the new window. Does anyone know
> how
> to do that? Thanks.
Hi lanem,

If you want to pass data to other pages, it's better to use Session, Cookie
rather than ViewState. ViewSate stores data in page hidden field, can not be
retrieved in other pages.

HTH

Elton Wang

"lanem" wrote:

> I want to pop open a new window from my asp.net 2.0 web page. I want it to
> pass or submit the current viewstate to the new window. Does anyone know how
> to do that? Thanks.

0 comments:

Post a Comment