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

Problem getting ActiveViewIndex

My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.

The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.

But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do

Multiview1.GetActiveView().ID;

I always get the name of the first view.

What is wrong? I googled, but haven't found anyone experiencing this
problem yet.

Aug 14 '07 #1
4 2827
On Aug 14, 12:08 pm, "antonyliu2...@yahoo.com"
<antonyliu2...@yahoo.comwrote:
My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.

The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.

But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do

Multiview1.GetActiveView().ID;

I always get the name of the first view.

What is wrong? I googled, but haven't found anyone experiencing this
problem yet.
As a follow-up, I did set the active view index when a linkbutton is
clicked, like so:

MultiView1.ActiveViewIndex = 0; or
MultiView1.ActiveViewIndex = 1; or
MultiView1.ActiveViewIndex = 2; or
MultiView1.ActiveViewIndex = 3;

Aug 14 '07 #2
On Aug 14, 12:08 pm, "antonyliu2...@yahoo.com"
<antonyliu2...@yahoo.comwrote:
My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.

The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.

But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do

Multiview1.GetActiveView().ID;

I always get the name of the first view.

What is wrong? I googled, but haven't found anyone experiencing this
problem yet.
Again, it is because of the postback ghost.

In Page_Load, I did

MutiView1.ActiveViewIndex = 0;

Wrapping it up with

if (!Page.IsPostBack)
{
// That ghost line here.
}

Solves the problem.

Question: Does a page ALWAYS post back to itself when any button is
clicked? On my web form I attempt to redirect to another page
through:

Response.Redirect("AnotherPage.aspx");

when the [Submit] button is clicked.

It looks like that the web form is posted back to itself, such that if
you don't do

if (!Page.IsPostBack)

, the ActiveViewIndex will again be set to 0. Right?

Aug 14 '07 #3
Have you tried storing the activeview in a session variable, updated each
time the buttons are clicked?

Ross
<an***********@yahoo.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...
My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.

The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.

But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do

Multiview1.GetActiveView().ID;

I always get the name of the first view.

What is wrong? I googled, but haven't found anyone experiencing this
problem yet.

Aug 14 '07 #4
On Aug 14, 3:44 pm, "Ross Culver" <rcul...@warrenalloy.comwrote:
Have you tried storing the activeview in a session variable, updated each
time the buttons are clicked?

Ross

<antonyliu2...@yahoo.comwrote in message

news:11*********************@r34g2000hsd.googlegro ups.com...
My web form has a MultiView which has 4 Views. 4 LinkButtons on the
web form activates each of the 4 views.
The 4 views have been hiding and showing nicely depending upon which
LinkButton is clicked.
But, when I try to get the ActiveViewIndex when the [Submit] button is
clicked, I always get 0. Or if I do
Multiview1.GetActiveView().ID;
I always get the name of the first view.
What is wrong? I googled, but haven't found anyone experiencing this
problem yet.
No, there is not need to do that now.

Aug 15 '07 #5

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

Similar topics

11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
3
by: michael haller | last post by:
In my project i have a textfile witch i import in my c# application. The datas in the textfile i show the datas in the textfile in my datagrid..ok that ist not my problem. Now i have a...
0
by: Avon | last post by:
Hi friends, I am very sorry for my not perfect English. I have one question, I am using David Bauer's DynamicControlsPlaceholder to dinamically generate controls and I am tryig to generate...
1
by: Martin | last post by:
Hi, I have a FormView control with a MultiView control within it's EditItemTemplate (because using a Wizard doesn't maintain two way data binding - MS confirmed bug). Any how, I have the...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
0
by: merco | last post by:
Hi. I have some problems using gridview bind to a datatable: i can't get updated values in then RowUpdating : i think the problem is that the datasource is nothing... I'm not using visual...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
0
by: Tim | last post by:
Hi all, I'm using AJAX.NET and I've coded a page that changes the text of a button when a checkbox is clicked. The text changes from "Save" to "Keep Processing". The text change seems to...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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 projectplanning, 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.