如何动态分配js名称 [英] How to dynamically assign js name

查看:70
本文介绍了如何动态分配js名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用js(example1.js)。我想根据登录empid动态分配该名称。

请帮助。







I am calling a js(example1.js). I want to assign that name dynamically as per the login empid.
Please help.



<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="True"

    Inherits="PM_Roots_RootChild" Title="Organisation Chart" CodeFile="RootChild.aspx.cs" %>

<%@ Register Src="../../UserControl/UCSearch.ascx" TagName="UCSearch" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    <link type="text/css" href="../../Css/base.css" rel="stylesheet" />
    <link type="text/css" href="../../Css/Spacetree.css" rel="stylesheet" />
    <!--[if IE]><script language="javascript" type="text/javascript" src="../../Extras/excanvas.js"></script><![endif]-->
    <!-- JIT Library File -->
    <script language="javascript" type="text/javascript" src="../../JavaScripts/jit.js"></script>
     <script src="js/example1.js" type="text/javascript"></script>

      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <table style="width: 100%">
                <tr>
                    <td>
                        Employee Name
                    </td>
                    <td class="style1">
                        <uc1:UCSearch ID="UCpeople" runat="server" Visible="true" TableName="EMPMASTER" Record_Size="8"

                            Aid_Field_Name="Employee Id" Desc_Field_Name="Name,Designation,department,Location"

                            Display_Field="Name" Enable="true" Mid_Field_Name="Employee Code" Filter_Values="Name,Designation,Department,Location,EmailID,Joining Date,PAN No"

                            __designer:wfdid="w2"></uc1:UCSearch>
                    </td>
                    <td>

推荐答案

Page.Header.Controls.Add(new LiteralControl());





取代< b> FileName< / b>根据您的要求在代码隐藏中添加您的FileName。
Page.Header.Controls.Add(new LiteralControl(""));


In place of <b>FileName</b> add your FileName in codebehind according to your requirement.


这篇关于如何动态分配js名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆