This is a migrated thread and some comments may be shown as answers.

Script Manager

0 Answers 143 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 28 Mar 2009, 02:44 PM
Dear All

         i Used the code for the Image Uploader Functionality. In this functionality to have include the asp.net Controls and some Java Script function. In my requirement when i click the button that the image uploader panel displayed and already i told u know In this panel to have asp.net controls and java script functionality. When i click this button that time asp.net controls part is only showing. Bt not showing java script part. Let me know how can i solve this problem. Here i attached my coding. Pls. Give me a solution at earliest.

<asp:Content ID="AddAreaContent" runat="server" contentplaceholderid="contentMaster">

<script language="javascript" type="text/javascript" >

    function ClearValues() {        
        $find("<%= cmbAddAreaParent.ClientID %>").clearSelection();
        $find("<%= txtAddArea.ClientID %>").clear();
     
        $find("<%= txtAddAreaTrans.ClientID %>").clear();
        $find("<%= txtAddAreaLocal.ClientID %>").clear();        
        $get("<%= chkAddAreaActive.ClientID %>").checked = false;       
    }   
 </script>
 <link href="style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
    //<![CDATA[    
    var bitBucket = 0;
    var desktop = 1;
    var myComputer = 2;
    var myDocuments = 3;
    var myMusic = 4;
    var myPictures = 5;
    var myVideo = 6;
    var network = 7;

    function changeView(view) {
        getImageUploader("ImageUploader1").setFolderView(view);
    }

    //Check if appropriate special folder (My Documents, Desktop, etc) exists.
    //If some of these folder is missing, hide appropriate button.
    function checkButton(name, folderId) {
        if (getImageUploader("ImageUploader1").CanGoToFolder(folderId)) {
            document.getElementById(name + "Holder").style.display = "block";
        }
    }

    //window.onload = function(){
    function FullPageLoad() {
        checkButton("Desktop", desktop);
        checkButton("MyDocuments", myDocuments);
        checkButton("MyComputer", myComputer);
        checkButton("MyPictures", myPictures);
        checkButton("MyVideo", myVideo);
        checkButton("Network", network);
    }
    //]]>
    </script>
    
        <div id="addareapnl">
            <asp:Panel ID="pnlAddArea" runat="server" GroupingText="<%$ Resources:AdminResource,pnladdarea %>">
                <asp:Label ID="lblAreaExists" runat="server" CssClass="requiredfieldColor"></asp:Label>                            
                <div class="parentarea">                   
                        <asp:Label ID="lblAddAreaParent" runat="server" Text="<%$ Resources:AdminResource,lblparentarea%>" ToolTip="<%$ Resources:AdminResource,ttparentarea%>"></asp:Label>                    
                </div>
                
                  <!-- Destination-->
                 <div class="parentareacmb">
                      <telerik:RadAjaxPanel ID="AreaAjaxpanel" runat="server">
                          <telerik:RadComboBox ID="cmbAddAreaParent"  AutoPostBack="true" runat="server" width="150px" Font-Size="Small">                                                                               
                          <CollapseAnimation Duration="200" Type="OutQuint" />                          
                          </telerik:RadComboBox>                                                      
                      </telerik:RadAjaxPanel>                        
                 </div>                         
                                             
                <div class="areaname">
                    <asp:Label ID="lblAreaName" runat="server" Text="<%$ Resources:AdminResource,lblareaname %>" ToolTip="<%$ Resources:AdminResource,ttareaname %>" CssClass="requiredfieldColor"></asp:Label>
                    <telerik:RadTextBox ID="txtAddArea" runat="server" width="150px" TabIndex="0" MaxLength="50">
                    </telerik:RadTextBox>                                 
                </div>
                <div class="areanamerequired">
                    <jet:PropertyProxyValidator ID="valtxtAddArea" runat="server" SourceTypeName=" Com.JetSoft.JetSoftFramework.Property.AreaData" ControlToValidate="txtAddArea" PropertyName="Name"> </jet:PropertyProxyValidator>
                </div>
             
                
                <div class="map">
                    <asp:Label ID="lblAddAreaMap" runat="server" Text="<%$ Resources:AdminResource,lblmap %>" ToolTip="<%$ Resources:AdminResource,ttmap%>"></asp:Label>
                  
                </div>
                <!--
                <div class="pictureslbl">
                      <asp:Label ID="Label1" runat="server" Text="<%$ Resources:AdminResource,lblpictures %>" ToolTip="<%$ Resources:AdminResource,ttpictures%>"></asp:Label>
                </div>
                
                <div class="imageset1">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/tempareaimg1.jpg" Height="100px" Width="100px" />
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/tempareaimg2.jpg" Height="100px" Width="100px"  />
                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/tempareaimg1.jpg" Height="100px" Width="100px"  />
                </div>
                 
                <div class="imageset2">
                    <asp:Image ID="Image4" runat="server" ImageUrl="~/Images/tempareaimg2.jpg" Height="100px" Width="100px" />
                    <asp:Image ID="Image5" runat="server" ImageUrl="~/Images/tempareaimg1.jpg" Height="100px" Width="100px"  />
                    <asp:Image ID="Image6" runat="server" ImageUrl="~/Images/tempareaimg2.jpg" Height="100px" Width="100px" />                        
               </div>                      
               -->                  
                
                <div class="active">
                    <asp:Button ID="BtnImagesPnl" Text="Click" runat="server"
                            onclick="BtnImagesPnl_Click" />
                </div>

                <div class="active" id="Whole">
                <asp:Panel id="pnlUploadImages"  Visible="false" runat="server">
                
                <table cellpadding="0" cellspacing="3" border="0">
                <tr>
                <td align="right">
                    Look in:</td>
                <td>
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                <td>
                <telerik:RadAjaxPanel ID="pnl" runat="server">
                <telerik:RadScriptBlock ID="radScript1" runat="server">
                <script type="text/javascript">
                    //<![CDATA[
                    //Create JavaScript object that will embed ShellComboBox to the page.z
                    var sc = new ShellComboBoxWriter("ShellComboBox1", 420, 24);

                    //For ActiveX control full path to CAB file (including file name) should be specified.
                    sc.activeXControlCodeBase = "../ImageUploader5.cab";
                    sc.activeXControlVersion = "5,7,24,0";

                    //For Java applet only path to directory with JAR files should be specified (without file name).
                    sc.javaAppletCodeBase = "../";
                    sc.javaAppletCached = true;
                    sc.javaAppletVersion = "5.7.24.0";

                    //Configure appearance.
                    sc.addParam("BackgroundColor", "#ece9d8");

                    //Link ShellComboBox with ImageUploader
                    sc.addParam("AdditionalFolderNavigator", "ImageUploader1");

                    //Tell the ShellComboBox writer object to generate all necessary HTML code to embed
                    //it to the page.
                    sc.writeHtml();
                    //]]>
                </script>
                </telerik:RadScriptBlock>
                </telerik:RadAjaxPanel>
            </td>
            <td align="right">
            <button onclick="getImageUploader('ImageUploader1').GoToPreviousFolder();" title="Back" class="SmallButton">
                <img src="Images/Back.gif" alt="Back" class="Icon" /></button>
                    <button onclick="getImageUploader('ImageUploader1').GoToParentFolder();" title="Up" class="SmallButton">
                        <img src="Images/Up.gif" alt="Up" class="Icon" /></button>
                    <button onclick="changeView(0);" title="Thumbnails" class="SmallButton">
                        <img src="Images/Thumbnails.gif" alt="Thumbnails" class="Icon" /></button>
                    <button onclick="changeView(3);" title="Details" class="SmallButton">
                        <img src="Images/Details.gif" alt="Details" class="Icon" /></button>
            </td>
            </tr>
            </table>
        </td>
        </tr>
        <tr>
            <td valign="top" class="LeftPanel">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td class="ShortcutPanel" valign="top">
                            <table>
                                <tr id="DesktopHolder">
                                    <td>
                                        <button title="Desktop" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(desktop);">
                                            <img src="Images/Desktop.gif" alt="Desktop" class="Icon" /><br />
                                            Desktop
                                        </button>
                                    </td>
                                </tr>
                                <tr id="MyComputerHolder">
                                    <td>
                                        <button title="My Computer" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myComputer);">
                                            <img src="Images/MyComputer.gif" alt="My Computer" class="Icon" /><br />
                                            My&nbsp;Computer
                                        </button>
                                    </td>
                                </tr>
                                <tr id="MyDocumentsHolder">
                                    <td>
                                        <button title="My Documents" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myDocuments);">
                                            <img src="Images/MyDocuments.gif" alt="My Documents" class="Icon" /><br />
                                            My&nbsp;Documents
                                        </button>
                                    </td>
                                </tr>
                                <tr id="MyPicturesHolder">
                                    <td>
                                        <button title="My Pictures" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myPictures);">
                                            <img src="Images/MyPictures.gif" alt="My Pictures" class="Icon" /><br />
                                            My&nbsp;Pictures
                                        </button>
                                    </td>
                                </tr>
                                <tr id="MyVideoHolder">
                                    <td>
                                        <button title="My Video" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myVideo);">
                                            <img src="Images/MyVideo.gif" alt="My Video" class="Icon" /><br />
                                            My&nbsp;Video
                                        </button>
                                    </td>
                                </tr>
                                <tr id="NetworkHolder">
                                    <td>
                                        <button title="Network" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(network);">
                                            <img src="Images/Network.gif" alt="Network" class="Icon" /><br />
                                            Network
                                        </button>
                                    </td>
                                </tr>
                            </table>
                        </td>
             </tr>
             <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <button title="Select All" onclick="getImageUploader('ImageUploader1').SelectAll();"
                                            class="Button">
                                            Select All</button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <button title="Upload" onclick="getImageUploader('ImageUploader1').Send();" class="Button">
                                            Upload</button>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
            <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                <script type="text/javascript">
                    //<![CDATA[
                    //Create JavaScript object that will embed Image Uploader to the page.
                    var iu = new ImageUploaderWriter("ImageUploader1", 550, 490);

                    //For ActiveX control full path to CAB file (including file name) should be specified.
                    iu.activeXControlCodeBase = sc.activeXControlCodeBase;
                    iu.activeXControlVersion = sc.activeXControlVersion;

                    //For Java applet only path to directory with JAR files should be specified (without file name).
                    iu.javaAppletJarFileName = sc.javaAppletJarFileName;
                    iu.javaAppletCodeBase = sc.javaAppletCodeBase;
                    iu.javaAppletCached = sc.javaAppletCached;
                    iu.javaAppletVersion = sc.javaAppletVersion;

                    iu.showNonemptyResponse = "off";

                    //Configure License Keys
                    iu.addParam("LicenseKey", "71050-4E10B-00000-026F4-59F7B;72050-4E10B-00000-03E16-7B80A");

                    //Configure appearance and behaviour.
                    iu.addParam("PaneLayout", "TwoPanes");
                    iu.addParam("FolderView", "Thumbnails");
                    iu.addParam("UploadView", "Details");
                    iu.addParam("PreviewThumbnailSize", "100");
                    iu.addParam("ShowButtons", "false");
                    iu.addParam("ShowSubfolders", "true");
                    iu.addParam("ShowDescriptions", "false");
                    iu.addParam("ShowContextMenu", "false");
                    iu.addParam("ShowDebugWindow", "true");
                    iu.addParam("AllowMultipleRotate", "true");

                    //Configure colors.
                    iu.addParam("PaneBackgroundColor", "#ffffff");
                    iu.addParam("BackgroundColor", "#ffffff");
                    iu.addParam("PreviewThumbnailActiveColor", "#f8b330");
                    iu.addParam("PreviewThumbnailInactiveColor", "#eeeeee");

                    //Hide tree pane.
                    iu.addParam("TreePaneWidth", "-1");

                    //Allow upload not only files, but also entire folders.
                    iu.addParam("AllowFolderUpload", "true");

                    //Single or multiple file selection.
                    //iu.addParam("AllowMultipleSelection", "false");

                    //Link ImageUploader with ShellComboBox.
                    iu.addParam("AdditionalFolderNavigator", "ImageUploader1");

                    //Configure file mask to display images only.
                    iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe;*.gif;*.png;*.tif;*.tiff;*.psd");

                    //Configure thumbnail settings.
                    iu.addParam("UploadThumbnail1FitMode", "Fit");
                    iu.addParam("UploadThumbnail1Width", "120");
                    iu.addParam("UploadThumbnail1Height", "120");
                    iu.addParam("UploadThumbnail1JpegQuality", "60");

                    //Configure upload settings.
                    iu.addParam("Action", "upload.aspx");
                    iu.addParam("FilesPerOnePackageCount", "1");
                    iu.addParam("AutoRecoverMaxTriesCount", "10");
                    iu.addParam("AutoRecoverTimeOut", "10000");


                    //Configure URL where to redirect after upload.
                    iu.addParam("RedirectUrl", "AddArea.aspx");

                    iu.fullPageLoadListenerName = "FullPageLoad";

                    //Tell Image Uploader writer object to generate all necessary HTML code to embed
                    //Image Uploader to the page.
                    iu.writeHtml();
                    //]]>
                </script>
                </telerik:RadScriptBlock>

                </td>
                </tr>
                </table>
                </asp:Panel>
           
                </div>
                
                  <asp:DataList ID="DataList1" Width="100%" RepeatLayout="Table" RepeatDirection="Vertical"
                        RepeatColumns="4" runat="server">
                 <ItemTemplate>
                    <a href="<%# galleryPath + EncodeFileName(((XmlElement)(Container.DataItem)).GetAttribute("name")) %>"
                    target="_blank">
                    <img src="<%# galleryPath + "Thumbnails/" + EncodeFileName(((XmlElement)(Container.DataItem)).GetAttribute("name")) %>.jpg"
                    alt="<%# Server.HtmlEncode(((XmlElement)(Container.DataItem)).GetAttribute("name"))%>" />
                    </a>
                    <br />
                    <br />
                    <b>Name:</b>
                    <%# Server.HtmlEncode(((XmlElement)(Container.DataItem)).GetAttribute("name")) %>
                    <br />
                    <b>Dimensions:</b>
                    <%# Server.HtmlEncode(((XmlElement)(Container.DataItem)).GetAttribute("width")) %>
                    x
                    <%# Server.HtmlEncode(((XmlElement)(Container.DataItem)).GetAttribute("height")) %>
                </ItemTemplate>
            </asp:DataList>
        
                
                <div class="trasportation">
                    <asp:Label ID="lbltrans" runat="server" Text="<%$ Resources:AdminResource,lbltransporation %>" ToolTip="<%$ Resources:AdminResource,tttransportation%>"></asp:Label>
                </div>
                
                <div class="trasportationtxt">
                    <telerik:RadTextBox ID="txtAddAreaTrans" runat="server" TextMode="MultiLine"  
                        Rows="15" Columns="138" TabIndex="2">
                    </telerik:RadTextBox>
                </div>  
                
                <div class="localactivities">
                    <asp:Label ID="lbllocal" runat="server"  Text="<%$ Resources:AdminResource,lbllocal %>" ToolTip="<%$ Resources:AdminResource,ttlocalactivities%>"></asp:Label>
                </div>  
                         
                 <div class="localactivitiestxt">
                    <telerik:RadTextBox ID="txtAddAreaLocal" runat="server"  TextMode="MultiLine"
                         Rows="15" Columns="138" TabIndex="3">
                    </telerik:RadTextBox>
                </div>
                
                <div class="active">
                    <asp:CheckBox ID="chkAddAreaActive" runat="server" Text="<%$ Resources:AdminResource,chkactive %>" ToolTip="<%$ Resources:AdminResource,ttAreaActive %>" TabIndex="4" />
                </div>
                
                                       
                 <div class="areaaddreset">
                    <asp:Button ID="btnAddArea"  runat="server"
                         Text="<%$ Resources:AdminResource,btnareaadd %>"
                         ToolTip="<%$ Resources:AdminResource,ttadd %>" onclick="btnAddArea_Click"
                         TabIndex="5" CausesValidation="true"/>                        
                    <asp:Button ID="btnReset" runat="server"
                         Text="<%$ Resources:AdminResource, btnContactReset %>"
                         CausesValidation="false"  ToolTip="<%$ Resources:AdminResource, ttReset%>" TabIndex="6" OnClientClick="ClearValues(); return false; "  />                     
                </div>
                
                <telerik:RadAjaxManager ID="pnlImageLoad" runat="server">
                <AjaxSettings>
                 <telerik:AjaxSetting AjaxControlID="BtnImagesPnl">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="pnlUploadImages"  LoadingPanelID="aloadingpanelSearchGrid"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>       
              </AjaxSettings>
            </telerik:RadAjaxManager>
            
            <telerik:RadAjaxLoadingPanel ID="aloadingpanelSearchGrid" runat="server" Height="75px"
                                Width="75px">
                                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page,"Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" />
                            </telerik:RadAjaxLoadingPanel>
     
            </asp:Panel>
        </div>                                        
</asp:Content>


Let me know How can i solve this problem

Thanks with Regards

Saravanan.M



No answers yet. Maybe you can help?

Tags
ScriptManager and StyleSheetManager
Asked by
Saravanan
Top achievements
Rank 1
Share this question
or