本文整理汇总了C#中System.Web.UI.ScriptReference类的典型用法代码示例。如果您正苦于以下问题:C# ScriptReference类的具体用法?C# ScriptReference怎么用?C# ScriptReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScriptReference类属于System.Web.UI命名空间,在下文中一共展示了ScriptReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("FocusBehavior.js");
return new ScriptReference[] { reference };
}
示例3: GetScriptReferences
protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("~/Scripts/jquery.maskedinput.min.js");
return new ScriptReference[] { reference };
}
示例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 };
}
示例5: GetScriptReferences
protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Path = ResolveClientUrl("SampleTextBox.js");
return new ScriptReference[] { reference };
}
示例6: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "AjaxButton";
reference.Name = "AjaxButton.FocusHighlighter.js";
return new ScriptReference[] { reference };
}
示例7: GetScriptReferences
protected override IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "PermissionCenter";
reference.Name = "PermissionCenter.PcGridHoverBehavior.js";
return new ScriptReference[] { reference };
}
示例8: ScriptReference
IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
{
ScriptReference reference = new ScriptReference();
reference.Assembly = "AjaxEnabled";
reference.Name = "AjaxEnabled.PassTextBox.js";
return new ScriptReference[] { reference };
}
示例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 };
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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 };
}
示例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 };
}