Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to cange the visibel view insife a multiview controll by code

Status
Not open for further replies.

JRVoyager

Programmer
Jun 18, 2003
15
SE
This might a real newbee question, but now i'm stuck.

I have a page with a multiview control on, inside this have i 2 view controlls.

how do I change between these two without using a button ?
What i have descovered is that when clicking a button so does a Postback event rise and the page is refreshed, but with my code does the postback not occure.

I have tried both the MultiView.SetActiveView and MultiView.ActiveViewIndex methods but without luck.

How can i either raise a postback event, or refresh the page so the change is visible ?
 
The SetActiveView method should work to change the view but you would have to use a Button (or another control that causes a postback) - I'm not sure why you want to do this without using a Button?

Have a look at the examples in the help file that show you how to do it:



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Hi c8msm

It me again, the guy with the problem with the Visitors screen :)

I have read this help section, from this i did draw the clue that the postback is the missing part.
If you recall the above thread do you understand why i want to do it without buttonclicks to fire the event.

I did have to give up the thought about the beautiful screenssaver so now are im aiming for a slideshow instead.
I have created a page with two views, one shall contain the slideshow (using a AdRotator to randomize the pictures) and the other view the actual "Welcome page".
I have the put an automatically refresh to the page with the MultiView to have it all rooling.

Regards
Gerth
 
OK, if you want to do it without a user having to click anything, then you will have to do it on the Page Load event. I guess it would go something like:
Code:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Select Case blnVistorsDue
            Case True
                MultiView1.SetActiveView(VisitorView)
            Case False
                MultiView1.SetActiveView(DefaultView)
        End Select
    End Sub


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks for the hint, i think i got a clue about the problem i face.
I do the test, as you suggest , already but i have it in the Page_Unload event as thats the point where i today test if the recordset have recieved any "visitors".
But when this event fires is the page already formated i think so it might be to late for the change to occure.

/Gerth
 
That's not the event you should be using to test whether vistors exist. Try either using the Page's Load or Init event instead.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top