Tag Archives: MultiView

[RESOLVED]Implementation of Tab Control using MultiView,View and Menu control in ASP.NET using VB.NET

I have used Multiview,view and Menu control in my design page. but it is not supporting in Google Chrome.

Plz someone help me fixing this problem.

Hi

Refer the below link if this is what you are looking for.

http://blog.turlov.com/2009/01/aspnet-ajax-compatibility-patch-for.html

Hope this helps.

Thanks.

Hi Datta,

Could you please elaborate a little bit more on the issue you are facing?  A example of this problem would be very helpful to determin where is the isisue.

Thanks.

Code Highlight problem after control selected

 Hi,

I have quite an annoying problem with VS 2008 in my web apps. I regularily have the display mode as Split, with the ASPX code window above the preview window. When I click on a single control to quickly access it’s ASPX code all of the ASPX code in the window
get’s highlighted instead of just the code for that control!

 

If anyone knows of a fix for this i would be very happy!

thanks

Hi,

From your description, do you mean that when you select a control in Design mode, the corresponding HTML code is not highlight in Source mode?

Firstly, please install SP1 for Visual Studio 2008 (http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en).

If we select a control and wait for a moment, is the code highlight? This happens in a background thread and may take couple of seconds.

I look forward to receiving your test results.

Thanks for your reply. You’re correct, the corresponding HTML code is not highlight in Source mode, but all of it (it could be a whole View, all of the MultiView, all of the Panel etc). I have installed SP1 and I still have the same problem. Restarting VS
2008 helps the problem for a short time but after working on the code I get the same problem. Even after restarting I still get the problem with certain controls like a Button within a Panel. 
I click the button and the whole Panel HTML code is highlighted. Also leaving it for a few seconds does not resolve the problem.

any ideas?

thanks

[RESOLVED]jquery fade methods with multiview .

i want to implement the fadeIn and fadOut like effects when i change a view of a multiview.

i.e., when  the view inside multiview changes it does not just disappear and a new one appears rather the present view fadeOut(); and another one appears fadeIn();

now i know doing it from server side but that does not complete my requirments;

please do reply whatever way of doing it you know. 

thaks in advance

if you want to do a transistion effect between pages then you need to use ajax. you start with 2 divs, one containing the current page, and one to contain the next page. once the next page is loaded, you do a transistion between them. 

this requires all ids to be unique between pages.

THANK YOU VERY MUCH BRUCE

 

but could you a little more explain what do you mean by a div containing a page 

do you mean to keep all contents of a page in one div and keep all contents of another page in a 2nd div and these both divs would be kept on the same page and fadeOut one div and then fadeIn the next div.

but is there anyway in which i can apply these jquery method to the view of  a multview.

and thanks again for your answer.

you got it, thats how its done, each page in its own div. with MVC you’d just use partial views, with webforms, you would have a stripped down multiview page with no master, or <html> , should just be a <form>.  you’d do an ajax post and place the response
in the div.

 

'Configure ListView' Not Showing

I created a few list views as components of views in multiview. Now I want to configure them but the Configure ListView option in the Smart Tag menu is not showing ?

Any ideas will be appreciated.

Humberto

Is there such an options for a ListView?  I don’t see it in my smart tag.  I think you have to build the listview manully using HTML markup or the properties window.  I might be wrong.

That is what it says here: http://msdn.microsoft.com/en-us/library/bb515103(VS.100).aspx

[RESOLVED]How to FindControl when control is in MasterPage "Featured Content"

I have a basic web app built with Vs 2012, .net 4.5, using the template for Asp.Net Web Forms Application.

This builds a Master page then I built a page inheriting the Maste page.

in the :
FeaturedContent section I have placed my controls.

among these are" a LinkButton LinkButton1, and a Multiview, Multiview1 (with a number of views)

the desired task is to click on Btn1 and have Multiview1 change it’s selected index to a desired
value.

On the Aspx Page:
<asp:LinkButton
ID="LinkButton1"
runat="server"
OnClick="LinkButton1_Click"><h8>Category
of event
</h8></asp:LinkButton></li>

On the Cs page:

protected void LinkButton1_Click(object sender, EventArgs e)

{MultiView CurView = (MultiView)FindControl("MultiView1");

CurView.ActiveViewIndex = 0;}

 

When the code runs the FindControl fails and CurView is null,  I have found several references
to this being a problem with the Master page in that it does something with the naming, the best solution I have found posted is to use code similar to:

//  For each c as Control in Container.Controls

//If TypeOf c Is ControlYouWant Then

//Dim ctl as ControlTypeYouWant = FindControl(c.ClientID)

//End If

//Loop

 

Of course things are never simple since Container.Controls apparently is not part of the collections available in the current context :(

So at long last: THE QUESTION — how to change the selected view on a Multiform located in a content section of a page inhierated from a Master page?

 

Sorry if this is long and rambling.

 

 

The multiview control is in the masterpage? If so, you need to use Master.FindControl() instead.

I hate it when I find the answer just after I post a question.

Solved with:

           

MultiView CurView = (MultiView)Page.Master.FindControl("FeaturedContent").FindControl("MultiView1");

Now I have a handle on the MultiView.

[RESOLVED]Multiview with Absolute Positioned Controls in Design Pane

I am writing a web page with a five view MultiView in Visual Web Developer. I need to add a number of controls in each view with absolute positioning set. When I look at this in the Design pane everything is on top of each other making it imposible to edit.
Is there something I can do to hide all but one view so I can work on it in the design pane. A workaraound would be to design them in separate pages then paste the code into the multivew. If there is some trick I can do to avoid this I would like to try it.

 I figured out a workaround, I made each of the views into .ascx user controls which I can edit separately and work out all the absolute positioning.

[RESOLVED]Make postback wait for javascript to complete

I am using a javascript to update a cookie when the user clicks an ASP button. That works fine.  I want the button to still do its postback to the server, but I need the postback to happen AFTER the javascript is finished updating the cookie.

<asp:LinkButton ID="lbIntroduction" runat="server" OnClientClick=’setCookie("MyVar", "0", "-1");’>

Hi,

try adding OnClick attribute on the linkButton

or

try just calling the __doPostBack(”,”); from ur JS function.

<asp:LinkButton ID="lbIntroduction" runat="server" OnClientClick='return setCookie("MyVar", "0", "-1");'>

setCookie function should return true after your logic.

This seems to work, but I think the underlying problem I am having is that I cannot overwrite a cookie once it has been changed via ASP.NET.

Below is the javascript function and ASP.NET property that I am using. When I use one method by itself, it works just fine. But if I first create the cookie with the javascript function it works until the cookie gets updated by the ASP.NET property. The
cookie cannot be changed via javascript at that point so it gets stuck on that view. Does ASP.NET do somthing to lock it’s cookies?

<script type="text/javascript">
    function setCookie(c_name, value, exdays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + exdays);
        var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
        document.cookie = c_name + "=" + c_value;
        return true;
    }
</script>

‘This is a property for a web user control.   

Public Shared Property MultiViewRequest As PageView
        Get
            If HttpContext.Current.Request.Cookies(CookiePreFix & "MultiViewRequest") Is Nothing Then
                Return PageView.Introduction
            Else
                Return CType(HttpContext.Current.Request.Cookies(CookiePreFix & "MultiViewRequest").Value, PageView)
            End If
        End Get
        Set(value As PageView)
            Dim aCookie As New HttpCookie(CookiePreFix & "MultiViewRequest")
            aCookie.Value = CStr(value)
            If HttpContext.Current.Request.Cookies(CookiePreFix & "MultiViewRequest") Is Nothing Then
                HttpContext.Current.Response.Cookies.Add(aCookie)
            Else
                HttpContext.Current.Response.SetCookie(aCookie)
            End If
        End Set
    End Property

Found it. Have to set aCookie.HttpOnly = False in the property. It is supposed to be false by default:

http://msdn.microsoft.com/en-us/library/system.web.httpcookie.httponly.aspx

[RESOLVED]modalpopup isn't modal

I have a modalpopup that was working fine before I added two viewpanels inside a multiview. I have placed one of the viewpanels around the modalpopup and the related popup panel. I populate the contents of the popup panel in code behind. This still works
but the popup panel no longer pops up in the center of the page but is visible when the viewpanel is shown. It get’s populated but remains in the same position at the bottom of the page and is not modal but allows buttons outside of the popup panel to be clicked
and activated.

Is there something about using a multiview that I need to know about when using the modalpopup extender?

After further investigating I can see that the MPE isn’t actually firing at all but I still can’t figure out why.

Finally fixed it. For anyone else who may be struggling with the same thing it appears the target button must be above the mpe.

Hi,

Thank you for sharing your solution. That will help others who meet the same issue.

Best wishes,

[RESOLVED]Some asp controls do not show up in design when using MasterPages

Hi!

Please do help me~

Some asp:controls such as Label and Required Validator do not show up on Design preview whenever I use them on my form. I’m using Master Pages, by the way.

I tried using a normal web form, it does show up in there.. but when I start to link it to my Master Page, it does not appear anymore.

Help!

Here’s the code for my Master page:

Here’s the code for my ContactUs page:


<asp:Content ID="contactus" ContentPlaceHolderID="main" runat="server">
    <div class="cont">
<div id="pages">
<div id="five"><h1>
       
        <span>Contact Us</span></h1></div>
<div id="entry3">

        <asp:MultiView ID="mcontacform" runat="server" ActiveViewIndex="0">
            <asp:View ID="contact" runat="server">
              
           
                <table width="600px">
                    <tr>
                        <td colspan="2">
                        <p>Fields with <font style="color: Red">*</font> are required.</p>
                        </td>
                        <td>
                          
                        </td>
                       
                    </tr>
                    <tr>
                        <td style="width: 100px;">
                            Name:<font style="color: Red">*</font>
                        </td>
                        <td style="width: 250px;">
                            <asp:TextBox ID="txtName" runat="server" Height="20px" Width="200px"

                BorderStyle="Solid" CssClass="fieldtext" TabIndex="1"></asp:TextBox>
                        </td>
                        <td>
                          
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"

                                ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
                          
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Email Address:<font style="color: Red">*</font>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server" Height="20px" Width="200px"

                CssClass="fieldtext" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Contact No.:</td>
                        <td>
                            <asp:TextBox ID="txtContact" runat="server" Height="20px" Width="200px"

                CssClass="fieldtext" TabIndex="3"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Subject:<font style="color: Red">*</font>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSubj" runat="server" Height="20px" Width="200px"

                CssClass="fieldtext" TabIndex="4"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Message:<font style="color: Red">*</font>
                        </td>
                        <td>
                            <asp:TextBox ID="txtMsg" runat="server" Height="112px" Width="256px"

                CssClass="fieldtext" TextMode="MultiLine"
                TabIndex="5"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
              
                <br />
            </asp:View>
             <asp:View ID="success" runat="server">
                 Thank you for taking the time in submitting your inquiry.<br />
                 We will get back to you within 24 hours.
                </asp:View>
        </asp:MultiView>
</div>
</div>
</div>
</asp:Content>

Need help, really. :(

bump~

bump~

Hi,

I tried your example and works fine! Can you show a dump of the error?

tmesi

Hi,

I tried your example and works fine! Can you show a dump of the error?

Really? :| It does not work for me. :( The Label and the Required Validator controls really do not show up. I tried removing the stylesheet, then it appears. O_O I tried putting it on again, and it doesn’t appear. :|

Hi,

It seems that the Stylesheet that is imported into Masterpage causes the issue.

Please check your stylesheet, especial in font color, whether div is hiding, z-index, etc, for the control.

To reproduce the issue, I think you also need to post the style here.

 

I look forward to receiving your test results.

Thomas Sun – MSFT

Hi,

It seems that the Stylesheet that is imported into Masterpage causes the issue.

Please check your stylesheet, especial in font color, whether div is hiding, z-index, etc, for the control.

To reproduce the issue, I think you also need to post the style here.

I look forward to receiving your test results.

Yes, it’s because of the stylesheet. I’ve fixed it already. Thanks! :)

Display dropdown based on checked box

Greetings again experts,

I have the following checkedbox items.

<input id="CheckBox9" runat="server" type="checkbox" value="Notary" />Notary
<input id="CheckBox10" runat="server" type="checkbox" value="VPN"  />VPN
<input id="CheckBox11" runat="server" type="checkbox" value="VPSPagecenter"  />VPS-Pagecenter
<input id="CheckBox12" runat="server" type="checkbox" value="PCDOC"  />PC DOC
<input id="CheckBox13" runat="server" type="checkbox" value="OnCall" />OnCall

Then I have 3 dropdown listbox items.

If the user checks the checkbox called Oncall, show only dropdown1. This dropdown has 2 items

If the user checks any checkbox(es) other than the OnCall checkbox, show dropdown2. This dropdown has 7 items.

If the user checks the OnCall checkbox and any other checkbox, show dropdown3. This one has 9 items, including the 2 items from dropdown1.

Or even better, this is a jQuery version I am playing with. If it works, it will do same thing I am trying to accomplish above.

I am getting an error on this, though.

How can I call this on my asp.net code?

<script type="text/javascript">
    if ($('#OnCall').attr('checked')) {
        $('#eProfile').hide();
        $('#kProfile').show()
    };
</script>

Can you please help?

Thank you so much in advance

Check following:

<input id="CheckBox9" runat="server" type="checkbox" value="Notary" class="other" />Notary
<input id="CheckBox10" runat="server" type="checkbox" value="VPN" class="other" />VPN
<input id="CheckBox11" runat="server" type="checkbox" value="VPSPagecenter" class="other" />VPS-Pagecenter
<input id="CheckBox12" runat="server" type="checkbox" value="PCDOC" class="other" />PC DOC
<input id="CheckBox13" runat="server" type="checkbox" value="OnCall" class="OnCall" />OnCall

<div id="dropdownHolder">
<select id="dropdown1">
    <option>item1</option>
    <option>item2</option>
</select>


<select id="dropdown2">
    <option>item3</option>
    <option>item4</option>
    <option>item5</option>
    <option>item6</option>
    <option>item7</option>
    <option>item8</option>
    <option>item9</option>
</select>

<select id="dropdown3">
    <option>item1</option>
    <option>item2</option>
    <option>item3</option>
    <option>item4</option>
    <option>item5</option>
    <option>item6</option>
    <option>item7</option>
    <option>item8</option>
    <option>item9</option>
</select>
</div>

jquery structure:

$(function(){

    //initially all dropdowns are hidden
    $('#dropdownHolder select').hide();
    $('input:checkbox').click(function(){
        var isOnCall = $('.OnCall:checked').length,
            anyOther = $('.other:checked').length;
        $('#dropdownHolder select').hide();
        if (isOnCall > 0 &&  anyOther > 0){
        $('#dropdown3').show();
        }
        else if (isOnCall == 0 &&  anyOther > 0){
        $('#dropdown2').show();
        }
        else if (isOnCall > 0 &&  anyOther == 0){
        $('#dropdown1').show();
        }
        
    })
        

});

check out Live Demo

WOW!

Thank you very much urenjoy for your kindness!

It works real good when I run it as is on my machine.

However, when I tried to integrated into my asp.net form, it doesn’t work.

No errors but just hides all dropdowns no matter what I select.

Could it be because I am using

<asp:dropdownlist
id="dropdown1"
runat="server"
Width="144px">

instead of

<select
id="dropdown1"> 

I didn’t think that would matter.

Could it also be that the PC I am running your code on is on ie7 instead of 8 or 9?

Many thanks for your help. Very much appreciated.

 

Hi,

I am not sure what I am looking for in that link.

The current is sound.

I am just trying to figure out why it doesn’t work when I used dropdownlist instead of <select>…</select> option.

Or whether the fact that I have ie7 as opposed to ie8 or ie9 has anything to do with it.

If you use asp.net dropdown then you have to use ClientID to access in jquery.

suppose you use:

<asp:dropdownlist id="dropdown1" runat="server" Width="144px">
...
</asp:dropdownlist>
<asp:dropdownlist id="dropdown2" runat="server" Width="144px">
...
</asp:dropdownlist>
<asp:dropdownlist id="dropdown3" runat="server" Width="144px">
...
</asp:dropdownlist>

Then in jQuery:

$(function(){

    //initially all dropdowns are hidden
    $('#dropdownHolder select').hide();
    $('input:checkbox').click(function(){
        var isOnCall = $('.OnCall:checked').length,
            anyOther = $('.other:checked').length;
        $('#dropdownHolder select').hide();
        if (isOnCall > 0 &&  anyOther > 0){
        $('#<%=dropdown3.ClientID%>').show();
        }
        else if (isOnCall == 0 &&  anyOther > 0){
        $('#<%=dropdown2.ClientID%>').show();
        }
        else if (isOnCall > 0 &&  anyOther == 0){
        $('#<%=dropdown1.ClientID%>').show();
        }
        
    })

});

Note: above script must be in same aspx page.

Hi, I have spent days trying to get this to work without bothering you again.

 However, it still doesn’t work and I believe I know why.

I am using asp.net’s Multiview which has page Ids.

The checkbox is on page1. dropdownlist is on page2

<asp:MultiView ID="UserRequestForm" runat="server" ActiveViewIndex="0">

<asp:View ID="Page1" runat="server">

checkbox goes here

</view>


<asp:View ID="Page2" runat="server">

dropdownlist goes here

</view>


<asp:View ID="Page3" runat="server">

something else goes here

</view>

</multiview>

Is there anyway to manipulate this?

Lots of thanks for your time and patience.