Category Archives: WebPartManager

WebPartManager

Generation of designer file failed: Unknown server tag 'asp:WebPartManager'

Hi,

I recently rebuilt an application using the new Web Application Project in Visual Studio (rather than the previous Web Site Project).  I am using the January Futures CTP of Ajax and Webparts, (not to do anything with Ajax yet, just to fix drag and drop across
browsers).

A Web Application Project creates .designer.cs files for all of your aspx pages.  I am getting a warning on pages that contain an asp:WebPartManager or asp:WebPartZone control:

Warning   Generation of designer file failed: Unknown server tag 'asp:WebPartManager'.

 

 

Now if I try to add other controls to that page, Visual Studio can’t update the .designer.cs file for that page and I end up with errors.

I have seen many posts about correctly remapping web.config to use the Microsoft.Web.Preview assembly, and that does not seem to be my problem.  I have that set up as recommended and my code executes fine until I try to add new controls to my page.  I have
moved the Microsoft.Web.Preview.dll to my bin and added a reference.

Any idea why Visual Studio is having this issue?

 

Thanks,

Graham

Do you also have a reference to system.web.extensions.dll? I beleive the preview assembly has a dependency on this dll.

Hi,

I have similar problem with WAP project with custom control. Controls other than AJAX enabled work fine. However, the accordion control of the AJAX control toolkit gives me:

 Error 1 Element ‘Accordion’ is not a known element. This can occur if there is a compilation error in the Web site. 
Warning 2 Generation of designer file failed: Unknown server tag ‘ajaxToolkit:Accordion’. 

 My customer control does not have a web.config. That is in the root and my custom control is a subproject.

 I have the ajaxcontroltoolkit in the bin and the system.web.extensions.dll in the reference.

Jelle

Answer to the problem of Ajax is next:

I did not install the items in the toolbox so the designer IDE did not find them. Read the instructions on the ajax control toolkit website how to add the controls to the designer. This did the trick for me :-(.

Jelle

What instructions are you referring to?  Can you provide a link?  I looked through the site, and couldn’t find anything in the installation instructions that said you explicitly needed to add the controls to the designer.

I am still getting the errors:

Generation of designer file failed: Unknown server tag ‘asp:ScriptManager’

and

Generation of designer file failed: Unknown server tag ‘asp:WebPartManager’

 

 on any page that contains those controls.  I have Ajax 1.0 and January Futures CTP installed, and my web.config looks exactly like the one that came with the CTP, and my site is using Web Application Project.  I have exhausted every suggestion from other
forum posts such as Reseting the Toolbox, opening all your masterpages at the same time, making sure I have proper references to System.Web.Extensions.dll and Microsoft.Web.Preview.dll, etc.  Nothing gets rid of the error.

If I manually keep the designer.cs file up to date, then the appliction works fine.  That makes me think there is not a problem with my references, just something wrong with VS.

 

In addition to what is mentioned above, I had to remove this line of code: 
<cc1:ToolkitScriptManager
ID="tsmScriptManager"
runat="server"></cc1:ToolkitScriptManager>

Then click and drag the ToolkitScriptManager from the toolbox back onto my page for it to work correctly.

VS is a bit buggy with ajax control toolkit.

Mine works now though. Good luck.

JustinCM83

In addition to what is mentioned above, I had to remove this line of code: 
<cc1:ToolkitScriptManager
ID="tsmScriptManager"
runat="server"></cc1:ToolkitScriptManager>

Then click and drag the ToolkitScriptManager from the toolbox back onto my page for it to work correctly.

 

Thanks, this fixed it for me!! after an hour of searching

 

 

 

[RESOLVED]ModalPopupExtender disables asp controls in in other webparts

Hi,

I am having problems getting a ModalPopupExtender ajax control to work on a page.

I have a single page containing 4 or 5 web parts displaying data from a sql database.  I want to add a ModalPopupExtender that will open a popup for me to enter data into the same database.  I have got the popup opening, validating imput and saving the record
on close, but when the extenders code is on the page it disables the <asp:LinkButton> on the other web parts.  These link buttons open datalist EditItmTemplate> that are on the other web parts.

If I remove any reference to the ModalPopupExtender, the link buttons work.

A stripped down version of the code is below:

The ASPX code (recruits.aspx):

<form id="frmRecruits" runat="server">
       
       <ajaxtoolkit:toolkitscriptmanager ID="AjaxToolkitScriptManager" runat="server"/>

        <asp:WebPartManager ID="wpmRecruits" runat="server" OnAuthorizeWebPart="wpmRecruits_AuthorizeWebPart">
            <StaticConnections>
                <asp:WebPartConnection ID="wpConnRecruitDetails"
                    ConsumerID = "idRecruitDetails"
                    ProviderID="idRecruitAdminTools"
                    ConsumerConnectionPointID="SelectedRecruit"
                    ProviderConnectionPointID="SelectedRecruit" />

                           
            </StaticConnections>
 
        </asp:WebPartManager>
                
        <div id="leftNav">
            
        <asp:LinkButton ID="linkAddNewRecruit" runat="server" Text="new recruit"  />
         
<asp:webpartzone id="wpzLeftSideBar_01" runat="server">
                <ZoneTemplate>
                    <ucRecruitAdminTools:RecruitAdminTools ID="idRecruitAdminTools" runat="server" title="Recruit"/>
                                          
                </ZoneTemplate>
            </asp:webpartzone>

        </div>
        
        <div id="content">
            <div id="centreContent">
                <asp:WebPartZone ID="wpzCentre" runat="server">
                    <ZoneTemplate>
                        <ucRecruitDetails:RecruitDetails ID="idRecruitDetails" runat="server" title="Contact Details"  />
                        
                    </ZoneTemplate>
                </asp:WebPartZone>
            </div>
        </div>

        <asp:Panel ID="panelAddNewRecruit" runat="server"  CssClass="modalPopup">
            <div style="border: 1px solid #000000">

               <table style="background-color: #e3e2fe;">
                    <tr>
                        <td>Interview Date</td>
                        <td>
                            <asp:TextBox ID="txtInterviewDate" runat="server"/>
                            <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
                        </td>
                        <td>Unit</td>
                        <td>
                            <asp:DropDownList ID="ddlUnitID" runat="server">
                                <asp:ListItem Text="-Select Unit-" Value= ""></asp:ListItem>
                                <asp:ListItem Value="2643" Text="PE" />
                                <asp:ListItem Value="2641" Text="FA" />
                                
                            </asp:DropDownList>
                        </td>
                    </tr>
                      
                    <tr>
                        <td>FirstName</td>
                        <td>
                            <asp:TextBox ID="txtFirstName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtFirstName" runat="server" ErrorMessage="* Required" ControlToValidate="txtFirstName" />
                        </td>
                        
                        <td>MiddleInitial</td><td><asp:TextBox ID="txtMiddleInitial" runat="server"/></td>
                        <td>LastName</td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtLastName" runat="server" ErrorMessage="* Required" ControlToValidate="txtLastName" />
                        </td>
                    </tr>
                    <tr>
                        <td>Address</td>
                        <td><asp:TextBox ID="txtHomeAddress" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>City</td><td><asp:TextBox ID="txtHomeCity" runat="server"/></td>
                        <td>State</td><td><asp:TextBox ID="txtHomeState" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>ZipCode</td><td><asp:TextBox ID="txtHomeZipcode" runat="server" />-<asp:TextBox ID="txtHomeExtZipcode" runat="server"/>
                        </td>
                    </tr>
                   
                    <tr>
                        <td >
                            <asp:LinkButton ID="linkInsert" runat="server">Insert</asp:LinkButton>
                            <asp:LinkButton ID="linkCancel" runat="server">Close</asp:LinkButton>
                            
                        </td>
                    </tr>
                </table>
              
            </div>
        </asp:Panel>
  
        <ajaxToolkit:ModalPopupExtender ID="mpeAddNewRecruit" runat="server" 
                TargetControlID="linkAddNewRecruit"
                PopupControlID="panelAddNewRecruit" 
                BackgroundCssClass="modalBackground" 
                DropShadow="true" 
                CancelControlID="linkCancel" >
        </ajaxToolkit:ModalPopupExtender>
       
       </form>

ASCX code for one of the web parts (wpRecruitsDetails):

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="wpRecuitsDetails.ascx.vb" Inherits="PayPer_WebParts.wpRecuitsDetails" %>
<asp:DataList id="dataRecruitDetails" runat="server" DataKeyField="PersonID" 
        DataSourceID="dsRecruitInfoByID" 
        OnEditCommand="dataRecruitDetails_EditCommand" 
        OnCancelCommand="dataRecruitDetails_CancelCommand" 
        OnUpdateCommand="dataRecruitDetails_UpdateCommand">

    <ItemTemplate>
               
       <%-- <asp:LinkButton ID="linkEdit" runat="server" CommandName="edit">edit</asp:LinkButton>--%>
 <asp:Button ID="linkEdit" runat="server" Text="Edit" CommandName="edit" />
         <br /> <br />
       
        <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:Label ID="lblMiddleInital" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:Label ID="lblDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <strong>Interview Date</strong>
        <asp:Label ID="lblInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>'/>
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:Label ID="lblHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:Label ID="lblHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:Label ID="lblHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:Label ID="lblHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:Label ID="lblHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />

    </ItemTemplate>

    <EditItemTemplate>
        
        <asp:LinkButton ID="linkUpdate" runat="server" CommandName="update">update</asp:LinkButton>
             &nbsp;
        <asp:LinkButton ID="linkCancel" runat="server" CommandName="cancel">cancel</asp:LinkButton>
            <br />
        <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:TextBox ID="txtMiddleInitial" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:TextBox ID="txtDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calDateHired" runat="server" TargetControlID="txtDateHired" />

        <strong>Interview Date</strong>
        <asp:TextBox ID="txtInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:TextBox ID="txtHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:TextBox ID="txtHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:TextBox ID="txtHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:TextBox ID="txtHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:TextBox ID="txtHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />
     
    </EditItemTemplate>

</asp:DataList>

I also tried putting the popcontrol into its own ASCX web part and it would cause the same problem (and if I removed it from the <ZoneTemplate> the EditItemTemplates would work again).

Any suggestions?  I can post more code if need be

thanks

Ian

Hi,

Have you debug your code and see what make the issue?

Best wishes,

[RESOLVED]webpartmanager error iis6 >> iis7 (ScriptResource.axd missing- not loaded)

this code :

<asp:WebPartManager ID="myWPM" runat="server"> </asp:WebPartManager>

 automatically generates JavaScript code at the bottom of the page:

<script type="text/javascript">   __wpm =
new WebPartManager(); __wpm.overlayContainerElement = document.getElementById(‘MainContent_myWPM___Drag’);
__wpm.personalizationScopeShared =
false;   var zoneElement;
var zoneObject;   zoneElement = document.getElementById(‘MainContent_leftArea’);
if(zoneElement != null){ zoneObject = __wpm.AddZone(zoneElement,
‘ctl00$MainContent$leftArea’, true,
true, ‘#006E97′); zoneObject.AddWebPart(document.getElementById(‘WebPart_xxxxx’),
document.getElementById
(‘WebPartTitle_xxxx’),
true); } </script>

its working IIS6  ,no porblem .

but in IIS7 i have a serious problem:

when i debug on iE i have a missing file :

PORTAL/ScriptResource.axd?d=yvlvwPXN0fZX2lE4BVzQpFJkUsnl6wUSLl1CVSHoHUzDYqMA00OLJPY11BQNo74VrBLwaSsQdn8TzNkano9tLt1jXx61fjYUuTOERprcE00KgorBosITW4kG-GT20YMLVUlOeQ2&amp;t=ffffffffe64379eb" type="text/javascript"></script>

please help 

hi mvc_dev,

There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren’t within those ranges
any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript.

Please check out the link below and try the two ways:

Bug and Fix: ASP.NET fails to detect IE10 causing _doPostBack is
undefined JavaScript error or maintain FF5 scrollbar position

Hope it helps, If you need more assistance , please let me know.

[RESOLVED]Add line in the end of label text

<dx:ASPxLabel ID="lblGuidingText" ClientInstanceName="lblGuidingText" runat="server" Text="Group Type cannot be modified as it is being used by some procedure instances." +"<br />" Visible="false"
                                                        ToolTip="" ViewStateMode="Disabled" Style="font-family: Tahoma; font-size: 11px; font-weight:normal; color:gray; line-height:none;" >
                                                    </dx:ASPxLabel>
                                    

I want to add line after this label’s text like above but this is giving me parsing error.

hi

set label text from code behind 

or using javascript

<asp:Label ID="lblReturn" runat="server" Text="ADD A RETURN <BR/>NEW LINE"></asp:Label>

That work for me.

EDIT: BETTER EXAMPLE TEXT

label1.Text = "I AM HERE" + '<br/>' + "I AM NOW HERE";

hello

use n for new line for lable text

   <dx:ASPxLabel ID="lbl1"  runat="server" Width="170px">
        </dx:ASPxLabel>
        lbl1.Text = "New line n this will in new line";

above code on code behind

SeeDosRun

<asp:Label ID="lblReturn" runat="server" Text="ADD A RETURN <BR/>NEW LINE"></asp:Label>

That work for me.

EDIT: BETTER EXAMPLE TEXT

Not working for me it is giving me the output.

Group
Type cannot be modified as it is being used by some <BR/> procedure instances.
 

Set 

EncodeHtml="False"

<dx:ASPxLabel 
ID="lblGuidingText" ClientInstanceName="lblGuidingText" runat="server"
Text="Group Type cannot be modified as it is being used by some procedure instances.
" +"<br />" Visible="false" ToolTip="" ViewStateMode="Disabled" Style="font-family: Tahoma; font-size: 11px; font-weight:normal; color:gray; line-height:none;"
EncodeHtml="False">
</dx:ASPxLabel>

[RESOLVED]webpartzone issue

 I’ve  added in a WebPartManager to my web page, and when I view in browser, it throws the following error: 

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

When I set personalization to false,it works fine, but I need to display it in designmode, so I need to have personalization =true.

How to be?

Hi,

WebPart personalization uses ASPNETDB.mdf to store the personlized data.. You would need to install SQL Express first before using WebParts.. 

Check this thread for same issue:

http://forums.asp.net/t/1355323.aspx

http://forums.asp.net/p/1334649/2687978.aspx

ASP.NET has a default connection string called "LocalSqlServer", which creates the mdf file. To disable this, you can add <clear /> as the first item in the ConnectionStrings element in web.config. After that you can either add a new connection string with
that namn, but your connection string, or you can add one with another name. If you user your own name you need to specify that for the membership provider, profile provider etc in web.config.

WebPart personalization uses ASPNETDB.mdf to store the personlized data.. so be sure that your application is also pointing to ASP.NETDB when deploying so that you will be able to use WebParts personalization. See this thread:
http://forums.asp.net/p/1400394/3037294.aspx

[RESOLVED]Web Parts Drag and Drop

Hello everyone.

If we can drag and drop controls in WebPartZone in Browse mode?

Yes, you can . please have view this video if you want to how to drag and drop with webparts

http://www.microsoft.com/uk/msdn/screencasts/screencast/186/ASPNET-AJAX-Enabling-WebParts-Drag-and-Drop.aspx

If I can do it with ASP.Net web application? not with AJAX?

Hi,

I think the user can drag Web Parts controls to edit the layout of the page in design mode, whereas in browse mode only standard Web browsing functionality is available. And you should contains a
WebPartManager control and One or more zones in your pages.

For detailed information, you can refer here

http://msdn.microsoft.com/en-us/library/ms366533(v=vs.100).aspx

[RESOLVED]Error Retrieving current

I am working an example where I am using a web user control to define a webpart.  However, when I try to get the current webpart manager I get the following error:

Error 2 An object reference is required for the nonstatic field, method, or property ‘System.Web.UI.Control.Page.get’ C:UsersTom MagaroDocumentsVisual Studio 2005WebSitesABC_IncWebPartsSimpleDisplayModeMenu.ascx.cs 14 66 C:…ABC_Inc

Here is my code

public partial class WebParts_DisplayModeMenu : System.Web.UI.UserControl

 {

    WebPartManager WPM = WebPartManager.GetCurrentWebPartManager(Page);

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    void Page_Init(object sender, EventArgs e)

    {

    }

    void Page_InitComplete(object sender, EventArgs e)

    {        

     string modeName;

     ListItem ddlModeItem;

     foreach(WebPartDisplayMode displayMode in WPM.SupportedDisplayModes)

     {

        modeName = displayMode.Name;

        if (displayMode.IsEnabled(WPM))

       {

         ddlModeItem = new ListItem(modeName, modeName);

         ddlMode.Items.Add(ddlModeItem);

       }

      }

      if (WPM.Personalization.CanEnterSharedScope)        

     {  

       pnlPersonalizeMode.Visible = true;

       if (WPM.Personalization.Scope == PersonalizationScope.User)  

      {

        rdbUserScope.Checked = true;

      }

      else

      {

        rdbSharedScope.Checked = true;

      }

     }

    }

    protected void ddlMode_SelectedIndexChanged(object sender, EventArgs e)    

   {

    string selMode;

    WebPartDisplayMode displayMode;

    selMode = ddlMode.SelectedValue;

    displayMode = WPM.SupportedDisplayModes[selMode];

    if (!(displayMode == null))

    {

     WPM.DisplayMode = displayMode;      

    }  

   }

}

 

The example is written in VB but I have transposed it to C#.  Is the Page object correct?

flashman

 WebPartManager WPM = WebPartManager.GetCurrentWebPartManager(Page);

 

Is ‘Page" name of your page? Basically it expects tha Web page that contains an instance of the WebPartManager.

No, that is just what was given in the example.  How would I retrieve the name of the containing page?

Try this

public partial class WebParts_DisplayModeMenu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            WebPartManager WPM = WebPartManager.GetCurrentWebPartManager(this.Parent.Page);
        }
    }

Hey Bimalvv,

 

Thanks for the info.  The example didn’t no have the statement in the load event.

It worked thanks.

 

[RESOLVED]asp.net checkbox client event not getting invoked

Hi,

I have a asp.net checkbox, in which i have a onclientclick javascript function called. If the checkbox is checked, I am trying to make a "asp:panel" visible.

I have tried the below code, but without success:

function toggleVisibility(cb) {
        var x = document.getElementById('<%=pnlTestID %>');
        if (cb.checked == true)
            x.style.display = "block";
        else
            x.style.display = "none";
    }


 <asp:CheckBox ID="chkTest" runat="server" Text="Test ID" OnClientClick="javascript:toggleVisibility(this); return false"  />

  <asp:Panel ID="pnlTestID" runat="server" Visible="false">

//some other controls

</asp:Panel>

How to fix this?

Thanks

Hi,

Have a look at this article.  It may explain the behavior you are experiencing.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.checkbox.autopostback(v=vs.110).aspx

HTH, Benjamin

Instead of OnClientClick, you need to write OnChange event of Checkbox. Also, you have set Panel’s Visible property to false; this is a server side property and by setting it to false will mean that the panel will never render on the page, since you will
always get null in JavaScript when you try to access the panel; hence, you should set the display:none style property instead of visible=false. Here is a working example:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function toggleVisibility() {
            var pnlTestID = document.getElementById("<%=pnlTestID.ClientID %>");
            if (document.getElementById("<%=chkTest.ClientID%>").checked == true)
                pnlTestID.style.display = "block";
            else
                pnlTestID.style.display = "none";
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:CheckBox ID="chkTest" runat="server" Text="Test ID" onchange="toggleVisibility();" />
            <asp:Panel ID="pnlTestID" runat="server" Style="display: none">
                Test Panel
            </asp:Panel>
        </div>
    </form>
</body>
</html>

hope it helps./.

EDIT: removed this in javascript.

Hi,

I tried the above code.

Initially the checkbox is not checked, so the panel should be hidden. But When the checkbox is not checked also, i can see the contents of the panel.

Also, the above code does not seem to work.

Thanks

 

venkatzeus

Initially the checkbox is not checked, so the panel should be hidden. But When the checkbox is not checked also, i can see the contents of the panel.

Also, the above code does not seem to work.

The code seems 100% fine on my side. Panel is hidden initially because I have set the style as "display:none". Also, when checkbox is not checked the panel is hidden. Try running above code in separate application and it will work. There might be some other
script issue on your page. Please check.

Hi,

have you removed Visible="false" and added style="display:none;"> 

bcz Visible=false is the server side code and you cannot handle those element in client side javascript. as given by kaushal change your code. it should work..

Hi,

In the view source, i can see the below:

function toggleVisibility() {
        var x = document.getElementById('System.Web.UI.WebControls.Panel');
        if (document.getElementById('ctl00_SPWebPartManager1_g_0e49dae5_6b94_4d19_95c9_cb638a841bc9_chkTest').checked == true) {
            x.style.display = "block";
        }
        else { x.style.display = "none"; }

And, there is a javascript error which is “Unable to get value of the property ‘style’: object is null or undefined”

Also, in viewsource, i see the below for the panel:

    <div id="ctl00_g_0e49dae5_6b94_4d19_95c9_cb638a841bc9_pnlTest" style="display: none">

I am not sure, how the panel rendered as a div.

Thanks

Hi,

you have to use 

 var x= document.getElementById("<%=pnlTestID.ClientID
%>"
);  instead of var x= document.getElementById("<%=pnlTestID %>");

panels will render as div only at client..

pls refer kaushal’ rly..

venkatzeus

var x = document.getElementById('System.Web.UI.WebControls.Panel');

Something is not correct at this line.

Have you tried retrieving the panel as:

            var x = document.getElementById("<%=pnlTestID.ClientID %>");

Hi,

The below code works fine in Mozilla, but not in IE 9 .

<script type="text/javascript">
        function toggleVisibility() {
            var pnlTestID = document.getElementById("<%=pnlTestID.ClientID %>");
            if (document.getElementById("<%=chkTest.ClientID%>").checked == true)
                pnlTestID.style.display = "block";
            else
                pnlTestID.style.display = "none";
        }
    </script>
</head>

            <asp:CheckBox ID="chkTest" runat="server" Text="Test ID" onchange="toggleVisibility(); return false" />

Thanks

 

There is no need to write return false. Try to set a test alert in script to check it executes or not

use jquery (jquery 1.4.4)..something like this:

http://jsfiddle.net/karim79/2hw89/1/

<script type="text/javascript">
$('#chkTest').change(function(){ 
$('#pnlTestID').toggle(this.checked).focus();
});
</script>

HI,

Thanks for the reply.

I even tried removing the "return false". But the same issue is shown in IE 8, 9.

Hello There,

Try To use JQuery to do this Cool

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
 
 <script type="text/javascript">
     jQuery.noConflict();
     jQuery(document).ready(function () {


         jQuery('#<%=chkTest.ClientID%>').click(function () {
             jQuery("#<%=pnlTestID.ClientID %>").toggle(this.checked);
         });

     });

     

 </script>

 <style type="text/css">
 .pnlStyle
 {
     display:none;
 }
 </style>


    <asp:CheckBox ID="chkTest" runat="server" Text="Test ID" />

  <asp:Panel ID="pnlTestID" runat="server" CssClass="pnlStyle">
      <asp:Label ID="lblDemo" runat="server" Text="Label Demo Text"></asp:Label>

</asp:Panel>

[RESOLVED]igoogle like interface in asp .net

 Hi,

 I want to develop igoogle like interface in a asp.net application. Is it possible through AJAX? 

Any pointers on this would be of great help

 

Cheers

Prady

iGoogle lets a person drag components around and add parts to it however they desire. ASP.NET has a way to do that called Web Parts. I don’t know about AJAX, though.

 definitely this book 

 http://search.barnesandnoble.com/Building-a-Web-20-Portal-with-ASPNET-35/Omar-Al-Zabir/e/9780596510503

which guide you to build this

 www.codeplex.com/dropthings

 

have fun

This can certainly be done, but you will need a firm foundation in JavaScript. The
ASP.NET AJAX Futures release has drag-n-drop functionality.

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DragPanel/DragPanel.aspx

You can also use Web Parts controls

https://www.ahsa.com.au/documentation/AJAX.Compatible.WebPartManager.zip

Webparts do not work inside the UpdatePanel in AJAX 1.0 (see
http://practicals-dot-net.blogspot.com/2007/06/workaround-web-parts-updatepanel.html
).

You can try this workaround: http://forums.asp.net/t/1087200.aspx

www.dropthings.com

Also there exists an alternative with touch device and responsive layout support.

See online demo at www.jdash.net/demo

More info can be found at www.jdash.net

Short info:

What is JDash.NET

jDash.Net is an Asp.Net Web Forms control library which allows you to easily and seemlessly integrate end user designed dashboards into your application. JDash.Net is browser and database independent.

Easy Development Using ASP.NET

Simply, develop regular Asp.Net user controls – ascx. JDash.Net automatically converts your user controls into drag-drop dashlets which in turn your users use dashlets to design their dashboards.

[RESOLVED]I am not able to get the drap and drop functionality in IE11

Is drag and drop functionality of Webparts supported in IE 11?

<asp:WebPartManager ID="WebPartManager1" runat="server">
            <StaticConnections>
                <asp:WebPartConnection ID="connection1"
                    ConsumerConnectionPointID="ZipCodeConsumer"
                    ConsumerID="zipConsumer"
                    ProviderConnectionPointID="ZipCodeProvider"
                    ProviderID="zipProvider" />
            </StaticConnections>
        </asp:WebPartManager>
        <div class="div1">
            <asp:WebPartZone ID="WebPartZone1" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <uc1:UserCtrlForProperty runat="server" ID="UserCtrlForProperty"/>
                    <asp:BulletedList ID="BulletedList1" runat="server" Title="Select Movie/Book">
                        <asp:ListItem Text="Books" Value="B"></asp:ListItem>
                        <asp:ListItem Text="Movies" Value="M"></asp:ListItem>
                    </asp:BulletedList>

                </ZoneTemplate>
            </asp:WebPartZone>
        </div>
        <div class="div2">
            <asp:WebPartZone ID="WebPartZone2" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <asp:Calendar ID="Calendar1" runat="server" Title="My Static Calendar"></asp:Calendar>
                </ZoneTemplate>
            </asp:WebPartZone>
        </div>

Hi,

For this situation, I have test the webparts in Internet Explorer 11, and it would not be able to support the drag and drop functionality. However, you could refer to the following links for more information:

http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html

http://www.codeproject.com/Articles/337551/A-Beginners-Tutorial-on-ASP-NET-Web-Parts

Regards