如何在Windows应用程序中重定向页面? [英] How to redirect page in windows application?

查看:88
本文介绍了如何在Windows应用程序中重定向页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我要问一个愚蠢的问题:


在asp.net中,我使用Response.Redirect(& ; Main.aspx")重定向页面,

但vb.net窗口中重定向表单的语法是什么?

应用程序?


我有一个登录页面,点击登录后,它会将页面指向

main.vb,但是错误表示未声明响应...... 。

谢谢。


* ----------------------- *

发表于:
www.GroupSrv.com

* ----------------------- *

解决方案

< blockquote>使用登录的最佳途径是使用你的main.vb来实例化一个

" Login"的实例。 ,

在login.vb中进行验证,然后将控制权返回给main.vb,这样....


''在load事件中Main.vb

dim x as new login

x.showdialog()


< showdialog强迫你关闭在它返回控件之前的形式>

x.show()也会起作用,但表格不是模态的


JenHu ; < JE ********** @ Hotmail的双点com.no-spam.invalid>在消息中写道

新闻:41 ********** @ Usenet.com ...

|大家好,

|

|我不得不问一个愚蠢的问题:

|

|在asp.net中,我使用Response.Redirect(Main.aspx)重定向页面,

|但vb.net窗口中重定向表单的语法是什么

|申请?

|

|我有一个登录页面,点击登录后,它会将页面指向

| main.vb,但错误表示未声明响应.......

|谢谢。

|

| * ----------------------- *

|发表于:

| www.GroupSrv.com

| * ----------------------- *


" JenHu" < JE ********** @ Hotmail的双点com.no-spam.invalid> schrieb:

在asp.net中,我使用Response.Redirect(Main.aspx)来重定向页面,
但是vb.net windows中重定向表单的语法是什么? br />申请?

我有一个登录页面,点击登录后,它会将页面指向
main.vb,但是错误上写着未声明响应。 .......




\\\

Dim MainForm作为新的MainForm()

MainForm.Show()

///


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>


正如Herfried和Clamps所指出的,WinForms之间的切换完全不同于WebForms之间的b $ b。 WinForms没有使用响应对象。

相反,你实例化你的表单实例,然后使用其中一个

show方法。


您可以在主表单显示之前创建并显示登录表单,或者让您的登录表单创建并显示您的主表单
OK按钮'



希望有所帮助,

Brian


-

Brian Schwartz

鱼网组件
http://www.fishnetcomponents.com

为开发人员构建更好的工具 - 加入其中!


Hi all,

I have to ask a stupid question:

In asp.net, I use Response.Redirect ("Main.aspx") to redirect pages,
but what is the syntax of redirect forms in vb.net windows
application?

I have a login page, after clicked "login", it will direct the page to
main.vb, but error says "response is not declared".......
Thanks.

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

解决方案

The best route to go with logins is to use your main.vb to instantiate an instance of
"Login" ,
do your validation in the login.vb, then return control to main.vb like so....

''in the load event of Main.vb
dim x as new login
x.showdialog()

<showdialog forces you to be close the form before it returns control>
x.show() will work too, but the form isn''t modal


"JenHu" <je**********@hotmail-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
| Hi all,
|
| I have to ask a stupid question:
|
| In asp.net, I use Response.Redirect ("Main.aspx") to redirect pages,
| but what is the syntax of redirect forms in vb.net windows
| application?
|
| I have a login page, after clicked "login", it will direct the page to
| main.vb, but error says "response is not declared".......
| Thanks.
|
| *-----------------------*
| Posted at:
| www.GroupSrv.com
| *-----------------------*


"JenHu" <je**********@hotmail-dot-com.no-spam.invalid> schrieb:

In asp.net, I use Response.Redirect ("Main.aspx") to redirect pages,
but what is the syntax of redirect forms in vb.net windows
application?

I have a login page, after clicked "login", it will direct the page to
main.vb, but error says "response is not declared".......



\\\
Dim MainForm As New MainForm()
MainForm.Show()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


As Herfried and Clamps indicate, switching between WinForms is completely
different than between WebForms. WinForms doesn''t use the response object.
Instead, you instantiate an instance of your form, and then use one of the
show methods on it.

You could either have your main form create and show the login form before
the main form shows, or have your login form create and show your main form
in its OK button''s event if the login is successful.

Hope that helps,
Brian

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Building better tools for developers--be part of it!


这篇关于如何在Windows应用程序中重定向页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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