473,287 Members | 1,926 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,287 software developers and data experts.

How to link multiple .aspx WebForms together?

Hi all,

I am new in ASP.Net. I have a question on link multiple web forms together.

Here is the scenario:

I create an Index.aspx WebForm which consists of a banner and three navigator buttons as well as a body to load the content. It is exactly like a normal HTML page where there are banner, menu bar, and body to load content. In my case, there are three .aspx WebForms which I have to link them together in the Index.aspx page. So that when users click on the navigator button, the corresponding webform will be loaded on the body. For example, users click on view profile navigation button, the profile.aspx page will be loaded in the content body.

From my opinion, the banner and navigator buttons should be created only once. Whereas the body to load the corresponding .aspx WebForms should be dynamic. Meaning, it knows what to load when users click on different buttons.

May I know how to accomplish the above task? By the way, I do not use Frame to separate the banner, navigator buttons, and body to load the webforms. I just use tables to separate them.

Actually, I tried the following codes as the code behind of each menu button in the Index.aspx:
Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Dim FunExc As New System.IO.StringWriter
Server.Execute("../customer/customeradd.aspx", FunExc)
lblChgDetail.Text = "<h2>Change Details</h2>" & FunExc.ToString
End Sub

Private Sub ImageButton2_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click
Dim FunExc2 As New System.IO.StringWriter
Server.Execute("../product/packageadd.aspx", FunExc2)
lblChgDetail.Text = "<h2>View Usage</h2>" & FunExc2.ToString
End Sub

However, it works only for the very first click on one menu button. For example, when I click on ImageButton1 at the very first time, the webform customeradd.aspx will be loaded at the body. However, if I clicked ImageButton1 again or clicked ImageButton2 after the first click, it shows the error message: "The viewstate is invalid for this page and might be corrupted."

*Remark: I put the following codes on the index.aspx, customeradd.aspx, and packageadd.aspx (the later two webforms are link by the menu buttons in index.aspx)
'Web Form Designer Generated Code
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.EnableViewState = False
End Sub

Thank you all.
--
Thanks,
rachel
Jul 21 '05 #1
3 3551
Rachel,

Lucky for you Microsoft thought about this long before you did. With
ASP.Net you can easily create custom UserControls. These use controls can
be created very easily and placed like other controls in ASP.Net pages.

Hope that answers your question

"rachel" <ra****@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.com...
Hi all,

I am new in ASP.Net. I have a question on link multiple web forms together.
Here is the scenario:

I create an Index.aspx WebForm which consists of a banner and three navigator buttons as well as a body to load the content. It is exactly like
a normal HTML page where there are banner, menu bar, and body to load
content. In my case, there are three .aspx WebForms which I have to link
them together in the Index.aspx page. So that when users click on the
navigator button, the corresponding webform will be loaded on the body. For
example, users click on view profile navigation button, the profile.aspx
page will be loaded in the content body.
From my opinion, the banner and navigator buttons should be created only once. Whereas the body to load the corresponding .aspx WebForms should be
dynamic. Meaning, it knows what to load when users click on different
buttons.
May I know how to accomplish the above task? By the way, I do not use Frame to separate the banner, navigator buttons, and body to load the
webforms. I just use tables to separate them.
Actually, I tried the following codes as the code behind of each menu button in the Index.aspx: Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click Dim FunExc As New System.IO.StringWriter
Server.Execute("../customer/customeradd.aspx", FunExc)
lblChgDetail.Text = "<h2>Change Details</h2>" & FunExc.ToString
End Sub

Private Sub ImageButton2_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click Dim FunExc2 As New System.IO.StringWriter
Server.Execute("../product/packageadd.aspx", FunExc2)
lblChgDetail.Text = "<h2>View Usage</h2>" & FunExc2.ToString
End Sub

However, it works only for the very first click on one menu button. For example, when I click on ImageButton1 at the very first time, the webform
customeradd.aspx will be loaded at the body. However, if I clicked
ImageButton1 again or clicked ImageButton2 after the first click, it shows
the error message: "The viewstate is invalid for this page and might be
corrupted."
*Remark: I put the following codes on the index.aspx, customeradd.aspx, and packageadd.aspx (the later two webforms are link by the menu buttons in
index.aspx) 'Web Form Designer Generated Code
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.EnableViewState = False
End Sub

Thank you all.
--
Thanks,
rachel

Jul 21 '05 #2
Hi Rachel,

A viewstate is on a page
A session is on the server

Therefore when you need to save information for different pages the best is
in my opinion to use the "session" for that, basicly do you use it in the
same way as the viewstate.

By the way, did you know that there is a newsgroup?

microsoft.public.dotnet.framework.aspnet

I hope this helps?

Cor
Jul 21 '05 #3
Can you provide some codes to illustrate your point? Thanks.

--
Thanks,
rachel
"Cor Ligthert" wrote:
Hi Rachel,

A viewstate is on a page
A session is on the server

Therefore when you need to save information for different pages the best is
in my opinion to use the "session" for that, basicly do you use it in the
same way as the viewstate.

By the way, did you know that there is a newsgroup?

microsoft.public.dotnet.framework.aspnet

I hope this helps?

Cor

Jul 21 '05 #4

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

Similar topics

1
by: JD | last post by:
Hi, I am using VS.NET 2003 with MFC7 and I have a link error: I use a library dll built with VC60 and mfc4.2, I have the export lib and include file for that library. The dll implements a Document...
1
by: Jerry Tovar | last post by:
I am using .Net 2003 on a XPPro running IIS. I am unable to view any of my ASPX webforms in a browser unless I modify the .ASPX file and replace Codebehind="employee.aspx.cs" with...
1
by: LidorP | last post by:
Hello All, My problem is as follows: I have an assembly which holds a number of WebForms. In order to use these WebForms in my WebApplication i have to extract them out of the assembly (using...
2
by: Luis E Valencia | last post by:
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid the link would be accoiones.aspx?iddireccion=2&idindicador=5 I tried...
0
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As...
3
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on...
3
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator...
1
by: monskie | last post by:
Hello to all, I have a problem which could be trivial to you guys. This concerns opening several crystal reports on the a crystal viewer on an ASPX page by calling window.open. My...
2
by: Michael | last post by:
It seems that a gridview allows us to delete only a single row at a time. How to extend this functionality to select multiple rows and delete all of the selected rows in a single stroke? just like...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.