无效的ViewState [英] Invalid ViewState

查看:80
本文介绍了无效的ViewState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个带有两个链接按钮的页面。当我点击第一个时,我调用

server.execute(" target.aspx")来查看原始页面上的target.aspx。

然后我点击第二个链接按钮,在这种情况下,我重定向到

另一个页面,但是,我得到了无效的ViewState异常。我知道问题

源于server.execute,但不知道为什么。任何想法?


谢谢。

Hello,

I have a page with two link buttons. When I click on the first one I call
server.execute("target.aspx") to view target.aspx on the original page.
Then I click on the second link button and in this case I redirect to
another page, HOWEVER, I get Invalid ViewState exception. I know the problem
stems from server.execute but don''t know why. Any Ideas?

Thank you.

推荐答案

当您调用Server.Execute时,第二页是作为

首页的一部分处理。如果第二页中有任何控件,这将影响ViewState的
(损坏),因为两个页面都有ViewState。我建议使用UserControl而不是第二页来使用

。如果需要,你可以动态地加载
加载UserControl。


-

HTH,

Kevin Spencer

Microsoft MVP

..Net开发人员

歧义具有一定的品质。


" Nad" < Na*@discussions.microsoft.com>在消息中写道

新闻:1B ********************************** @ microsof t.com ...
When you call Server.Execute, the second page is processed as part of the
first page. If the second page has any Controls in it, this will affect
(corrupt) the ViewState, as both pages have ViewState. I would recommend
using a UserControl instead of a second page instead. You can dynamically
load the UserControl if you need to.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Nad" <Na*@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
你好,

我有一个带有两个链接按钮的页面。当我点击第一个时,我调用
server.execute(" target.aspx")来查看原始页面上的target.aspx。
然后我点击第二个链接按钮,在这种情况下我重定向到另一个页面,但是,我得到了无效的ViewState异常。我知道
问题源于server.execute,但不知道为什么。有什么想法吗?

谢谢。
Hello,

I have a page with two link buttons. When I click on the first one I call
server.execute("target.aspx") to view target.aspx on the original page.
Then I click on the second link button and in this case I redirect to
another page, HOWEVER, I get Invalid ViewState exception. I know the
problem
stems from server.execute but don''t know why. Any Ideas?

Thank you.



谢谢,我会试一试。


" Kevin Spencer"写道:
Thank you, I''ll give it a try.

"Kevin Spencer" wrote:
当您调用Server.Execute时,第二页将作为
第一页的一部分进行处理。如果第二页中有任何控件,则会影响(损坏)ViewState,因为两个页面都有ViewState。我建议使用UserControl代替第二页。如果需要,你可以动态地加载UserControl。

-
HTH,

Kevin Spencer
Microsoft MVP ..Net开发人员
歧义具有一定的品质。

Nad < Na*@discussions.microsoft.com>在消息中写道
新闻:1B ********************************** @ microsof t.com。 ..
When you call Server.Execute, the second page is processed as part of the
first page. If the second page has any Controls in it, this will affect
(corrupt) the ViewState, as both pages have ViewState. I would recommend
using a UserControl instead of a second page instead. You can dynamically
load the UserControl if you need to.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Nad" <Na*@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
你好,

我有一个带有两个链接按钮的页面。当我点击第一个时,我调用
server.execute(" target.aspx")来查看原始页面上的target.aspx。
然后我点击第二个链接按钮,在这种情况下我重定向到另一个页面,但是,我得到了无效的ViewState异常。我知道
问题源于server.execute,但不知道为什么。有什么想法吗?

谢谢。
Hello,

I have a page with two link buttons. When I click on the first one I call
server.execute("target.aspx") to view target.aspx on the original page.
Then I click on the second link button and in this case I redirect to
another page, HOWEVER, I get Invalid ViewState exception. I know the
problem
stems from server.execute but don''t know why. Any Ideas?

Thank you.




嗨Kevin,


如何动态加载用户控件?


为什么在这个页面上如果我点击超链接列我就得不到

无效的ViewState错误,但是如果我想通过点击

链接按钮来重定向?

" Kevin Spencer"写道:
Hi Kevin,

How do you load a usercontrol dynamically?

Why is that when on this page if I click on on a hyperlinkcolumn I don''t get
that Invalid ViewState error but I do if I want to redirect by clicking on a
linkbutton?
"Kevin Spencer" wrote:
当您调用Server.Execute时,第二页将作为
第一页的一部分进行处理。如果第二页中有任何控件,则会影响(损坏)ViewState,因为两个页面都有ViewState。我建议使用UserControl代替第二页。如果需要,你可以动态地加载UserControl。

-
HTH,

Kevin Spencer
Microsoft MVP ..Net开发人员
歧义具有一定的品质。

Nad < Na*@discussions.microsoft.com>在消息中写道
新闻:1B ********************************** @ microsof t.com。 ..
When you call Server.Execute, the second page is processed as part of the
first page. If the second page has any Controls in it, this will affect
(corrupt) the ViewState, as both pages have ViewState. I would recommend
using a UserControl instead of a second page instead. You can dynamically
load the UserControl if you need to.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Nad" <Na*@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
你好,

我有一个带有两个链接按钮的页面。当我点击第一个时,我调用
server.execute(" target.aspx")来查看原始页面上的target.aspx。
然后我点击第二个链接按钮,在这种情况下我重定向到另一个页面,但是,我得到了无效的ViewState异常。我知道
问题源于server.execute,但不知道为什么。有什么想法吗?

谢谢。
Hello,

I have a page with two link buttons. When I click on the first one I call
server.execute("target.aspx") to view target.aspx on the original page.
Then I click on the second link button and in this case I redirect to
another page, HOWEVER, I get Invalid ViewState exception. I know the
problem
stems from server.execute but don''t know why. Any Ideas?

Thank you.




这篇关于无效的ViewState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆