JQuery Custom Control

I am trying to call a calender popup using custom controls which is not working

What i did

I download calender plugin shown below and run in my webpage - worked
(http://jqueryui.com/demos/datepicker/#icon-trigger)
I replaced the calendar JS and CSS files to dll - NOT WORKED
I added a Sample js and css file in the DLL and called that js and css - WORKED

Why the calender JS and css not worked?

Trials that i did
-----------------------
Changed the property to Embedded resource
Removed the DOTS from the Jquery JS files


This is the way i am calling the css:


 string cssDatePickerURL = Page.ClientScript.GetWebResourceUrl(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.datepicker.css");
 HtmlLink cssDatePicker = new HtmlLink();
cssDatePicker.Href = cssDatePickerURL;
 cssDatePicker.Attributes.Add("rel", "stylesheet");
 this.Page.Header.Controls.Add(cssDatePicker);


This is the way i am calling the JS:

  cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery-1.7.1.min.js");
            cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.core.js");
            cs.RegisterClientScriptResource(typeof(WebDate), "Infotech3i.TSG.WebControls.WebDate.jquery.ui.datepicker.js");
LVL 8
PeteEngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PeteEngineerAuthor Commented:
CSS files are taken but Java scripts are not.

In Fire Bug , HTML tag shows <Link> tag. There are 9 link tag each for my
CSS and Js files. In those CSS links are showing data properly but JS data
is showing as below :

<title>The resource cannot be found.</title>

<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The resource cannot be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> 
<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
<br><br>
<b> Requested URL: </b>/WebResource.axd<br><br>
<hr width=100% size=1 color=silver>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
</font>
</body>

Moreover, there is Firebug tab name CSS.

In that there is a dropdown which shows 9 webresource.axd?sfsdfsdfsdcsksdfkhskdf values where each describes the js and css files embedded as resource.

in those CSS resources are look fine, but for js nothing is visible and a blank page comes in the firebug console while i click

I have found following following trials to fix this issue : But no hope :-(

Added [assembly: WebResource("MyNamespace.MyScriptFile.js", "text/javascript")] above the class's namespace declaration.
Script file has build action "Embedded Resource".
Tried registering during OnInit, OnLoad and OnPreRender
Script file is in the same assembly and namespace as the control registering it its work fine.

Does not work using any of the following methods:
ScriptManager.RegisterClientScriptResource(Page, GetType(), "MyNamespace.MyScriptFile.js");


Page.ClientScript.RegisterClientScriptResource(GetType(), "MyNamespace.MyScriptFile.js");



Try implementing my own ScriptManger and then adding the embedded file from there. Here's an example

public class MyScriptManager : System.Web.UI.ScriptManager
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
RegisterClientScriptResource(this, typeof(ScriptManagerExtension), "MyNamespace.MyScriptFile.js");
}

typeof(WebDate)


[assembly: WebResource("Library.Resources.Scripts.libscript.js", "text/javascript", PerformSubstitution = true)]

Changed the order of js files

.BaseType

typeof(Company.Product.Web.Library.Class1)

Created Different solution for dll

Please help any other alternatives available?
0
PeteEngineerAuthor Commented:
Thanks God !!


Issue got fixed :

I issue was .i was using  javascript in the website which i was calling and was using
wrong client ID ..but when i embedded in the dll its working like below :

 string javascript = "<script type='text/jscript'> " +
                                 "$(document).ready(function () { " +
                                 "$('" + "#" + this.ClientID + "').datepicker(); " +
                                 "});</script>";

            Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, javascript);


Thanks for the help !
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.