本文整理汇总了C#中System.Web.UI.ScriptReference类的典型用法代码示例。如果您正苦于以下问题:C# ScriptReference类的具体用法?C# ScriptReference怎么用?C# ScriptReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScriptReference类属于System.Web.UI命名空间,在下文中一共展示了ScriptReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnLoad
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (string.IsNullOrEmpty(Path))
{
throw new ArgumentException("Script property must have a value");
}
var manager = ScriptManager.GetCurrent(Page);
if (manager == null)
{
throw new ArgumentException("No script manager found for the current page. Have you added a ScriptManager to the master page?");
}
System.Web.UI.ScriptReference scriptReference;
if (IsEmbedded)
{
var parentBaseType = Parent.GetType().BaseType;
var scriptResourcePrefix = parentBaseType.Namespace;
var scriptResourcePath = string.Format("{0}.{1}", scriptResourcePrefix, Path);
var assemblyName = parentBaseType.Assembly.GetName().Name;
scriptReference = new System.Web.UI.ScriptReference(scriptResourcePath, assemblyName);
}
else
{
scriptReference = new System.Web.UI.ScriptReference(Path);
}
manager.Scripts.Add(scriptReference);
}
开发者ID:joakes,项目名称:ExtensibleWebFeatures,代码行数:30,代码来源:ScriptReference.cs
示例2: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("FocusBehavior.js");
return new ScriptReference[] { reference };
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:FocusExtender.cs
示例3: GetScriptReferences
protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("~/Scripts/jquery.maskedinput.min.js");
return new ScriptReference[] { reference };
}
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:7,代码来源:esdMaskedTextBox.cs
示例4: GetScriptReferences
protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
//reference.Path = ResolveClientUrl("~/scripts/progress.js");
reference.Path = "~/scripts/progress.js";
return new ScriptReference[] { reference };
}
开发者ID:Confirmit,项目名称:Portal,代码行数:7,代码来源:UpdateProgressStatus.cs
示例5: GetScriptReferences
protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("SampleTextBox.js");
return new ScriptReference[] { reference };
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:SampleTextBox.cs
示例6: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "AjaxButton";
reference.Name = "AjaxButton.FocusHighlighter.js";
return new ScriptReference[] { reference };
}
开发者ID:robbytarigan,项目名称:EtCeteraBoilerPlate,代码行数:8,代码来源:FocusHighlighter.cs
示例7: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "PermissionCenter";
reference.Name = "PermissionCenter.PcGridHoverBehavior.js";
return new ScriptReference[] { reference };
}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:8,代码来源:DeluxeGridHoverExtender.cs
示例8: ScriptReference
IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "AjaxEnabled";
reference.Name = "AjaxEnabled.PassTextBox.js";
return new ScriptReference[] { reference };
}
开发者ID:robbytarigan,项目名称:EtCeteraBoilerPlate,代码行数:8,代码来源:PassTextBox.cs
示例9: GetScriptReferences
/// <summary>
/// Gets the script references.
/// </summary>
/// <returns></returns>
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), "Mediachase.Ibn.Assignments.UI.Scripts.Hider.js");
return new ScriptReference[] { reference };
}
开发者ID:0anion0,项目名称:IBN,代码行数:12,代码来源:HiderExtender.cs
示例10: GetScriptReferences
/// <summary>
/// Gets the script references.
/// </summary>
/// <returns></returns>
public override IEnumerable<ScriptReference> GetScriptReferences()
{
string assembly = typeof(TwitterDesigner).Assembly.FullName;
var scripts = new List<ScriptReference>(base.GetScriptReferences());
var designerScript = new ScriptReference(TwitterDesigner.designerScriptName, assembly);
scripts.Add(designerScript);
return scripts.ToArray();
}
开发者ID:jrcollado1987,项目名称:Telerik.Sitefinity.Samples.RealEstate,代码行数:12,代码来源:TwitterDesigner.cs
示例11: OpenScriptReference
public OpenScriptReference(ScriptReference reference) : base() {
Assembly = reference.Assembly;
IgnoreScriptPath = reference.IgnoreScriptPath;
Name = reference.Name;
NotifyScriptLoaded = false;
Path = reference.Path;
ResourceUICultures = reference.ResourceUICultures;
ScriptMode = reference.ScriptMode;
}
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:9,代码来源:OpenScriptReference.cs
示例12: Register
//public const string JQueryUrl = "http://code.jquery.com/jquery-1.8.3.min.js";
public static void Register(ScriptManager scriptManager)
{
// Check if JQuery has been added before
if (scriptManager.Scripts.FirstOrDefault(s => s.Path == JQueryUrl) != null)
{
return;
}
var sr = new ScriptReference(JQueryUrl);
scriptManager.Scripts.Add(sr);
}
开发者ID:skyquery,项目名称:graywulf,代码行数:12,代码来源:JQuery.cs
示例13: GetDefinition
public ScriptResourceDefinition GetDefinition(ScriptReference scriptReference) {
if (scriptReference == null) {
throw new ArgumentNullException("scriptReference");
}
string name = scriptReference.Name;
Assembly assembly = null;
ScriptResourceDefinition definition = null;
if (!String.IsNullOrEmpty(name)) {
assembly = scriptReference.GetAssembly();
definition = ScriptManager.ScriptResourceMapping.GetDefinition(name, assembly);
}
return definition;
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:13,代码来源:ScriptResourceMapping.cs
示例14: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
var script1 = new ScriptReference
{
Assembly = this.GetType().Assembly.FullName,
Name = "Msts.Scripts.Chapter09.PasswordLengthValidator.js"
};
var script2 = new ScriptReference
{
Assembly = this.GetType().Assembly.FullName,
Name = "Msts.Scripts.Chapter09.PasswordLengthBehavior.js"
};
return new[] { script1, script2 };
}
开发者ID:jupaol,项目名称:LearningProjects,代码行数:15,代码来源:PasswordLengthBehavior.cs
示例15: GetScriptReferences
public IEnumerable<ScriptReference> GetScriptReferences()
{
var script1 = new ScriptReference
{
Assembly = this.GetType().Assembly.FullName,
Name = "Msts.Scripts.Chapter09.PasswordLengthValidator.js"
};
var script2 = new ScriptReference
{
Assembly = this.GetType().Assembly.FullName,
Name = "Msts.Scripts.Chapter09.PasswordLengthControl.js"
};
return new[] { script1, script2 };
}
开发者ID:jupaol,项目名称:LearningProjects,代码行数:15,代码来源:PasswordLengthControl.cs
示例16: AddScriptVersion
public void AddScriptVersion(ScriptReference script)
{
var scriptName = Path.GetFileNameWithoutExtension(script.Path);
if (scriptName != null)
{
var element = root.Elements("script").FirstOrDefault(s =>
String.Equals(s.Attribute("name").Value, scriptName,
StringComparison.CurrentCultureIgnoreCase));
if (element != null)
{
script.Path += String.Format("?{0}", element.Attribute("v"));
}
}
}
开发者ID:EmberConsultingGroup,项目名称:ScriptManagerHandler,代码行数:16,代码来源:ScriptManifest.cs
示例17: AddScript
private void AddScript()
{
var page = HttpContext.Current.Handler as Page;
if (page == null)
{
throw new ArgumentException("Script Manager not found");
}
var manager = ScriptManager.GetCurrent(page);
if (manager != null)
{
var scriptReference = new ScriptReference("WebFeatures.Scripts.webChat.js", "WebFeatures");
manager.Scripts.Add(scriptReference);
}
// var script = page.ClientScript.GetWebResourceUrl(typeof(WebChat), "WebFeatures.Scripts.webChat.js");
// page.ClientScript.RegisterClientScriptInclude("WebChat", script);
}
开发者ID:joakes,项目名称:ExtensibleWebFeatures,代码行数:18,代码来源:WebChat.ascx.cs
示例18: ProcessLoadedScripts
/// <summary>
/// Replaces already loaded scripts with fake script.
/// </summary>
/// <param name="script">A <see cref="ScriptReference" /> object.</param>
private void ProcessLoadedScripts(ScriptReference script)
{
ICollection<AssetList> assetLists = AssetsHelper.LoadAssets();
string scriptUrl = ResourceUrlHelper.ResolveScriptManagerUrl(this, script);
foreach (KeyValuePair<string, string[]> loadedSet in LoadedScripts)
{
string setName = loadedSet.Key;
string[] setUrls = loadedSet.Value;
AssetList list = AssetsHelper.FindAssetList(assetLists, setName);
if (list == null) continue;
Asset asset = list.FindAsset(scriptUrl, setUrls);
if (asset == null) continue;
script.Name = "";
script.Assembly = "";
script.Path = ScriptHelper.GetCombinedScriptsUrl("fake", String.Empty);
break;
}
}
开发者ID:kpumuk,项目名称:assetpackager.net,代码行数:25,代码来源:AssetPackagerScriptManager.cs
示例19: Page_Load
/// -----------------------------------------------------------------------------
/// <summary>
/// Page_Load runs when the control is loaded
/// </summary>
/// -----------------------------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
try
{
hdnfld_UserID.Value = UserId.ToString();
string url = "";
//string[] parameters = new string[3];
//parameters = new string[1] { "user=" + UserIDLabel.Text };
// url = DotNetNuke.Common.Globals.NavigateURL(208, "");
// hprlnkLogin.NavigateUrl = url;
ScriptManager objScriptManager = ScriptManager.GetCurrent(this.Page);
ScriptReference objScriptReference;
objScriptReference = new ScriptReference(@"~/DesktopModules/Ourspace_Friends/js/friends.js");
objScriptManager.Scripts.Add(objScriptReference);
Ourspace_Utilities.View util = new Ourspace_Utilities.View();
bool isFacebookUser = util.IsFacebookUser(UserId);
if (isFacebookUser)
{
pnlNonFbInfo.Visible = false;
pnlFbFriends.Visible = true;
pnlSearchFacebookFriends.Visible = true;
}
else
{
pnlSearchFacebookFriends.Visible = false;
pnlNonFbInfo.Visible = true;
pnlFbFriends.Visible = false;
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
开发者ID:pbrigdenatc,项目名称:PlatformModules,代码行数:42,代码来源:View.ascx.cs
示例20: AddPathScriptReference
private void AddPathScriptReference(ScriptManager scriptManager, ScriptReference scriptReference)
{
if (scriptManager == null) { return; }
if (scriptReference == null) { return; }
//if (scriptManager.CompositeScript.Scripts.Contains(scriptReference)) { return; }
foreach (ScriptReference s in scriptManager.CompositeScript.Scripts)
{
if (s.Path == scriptReference.Path) { return; }
}
scriptManager.CompositeScript.Scripts.Add(scriptReference);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:12,代码来源:ScriptLoader.cs
注:本文中的System.Web.UI.ScriptReference类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论