|
Hi friends,
I am using .NET 2008 version. I want to include my js files, but not by standard way like '<script type="text/javascript" src="scripts/companyname/main.js"></script>' but from .cs file.
The problem is in above example, "companyname" can change and its comming from another xml file, which i am reading in .cs, so i have to give source of js file in cs.
I have found 1 function "RegisterClientScriptInclude" in C#, but its not working. Please any one can help me to perform my task or please show me how to use "RegisterClientScriptInclude" function.
Thanks for any help in advance. Happy Coding.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Hi Anand,
try this line of code where u r currently writing the RegisterClientScriptInclude function,replace with this
ClientScript.RegisterClientScriptBlock(typeof([ur .cs classname here]),"one"," ");
company name is a variable that will include the name from ur xml file
hope it helps
Rajeesh K
|
|
|
|
|
Thanks Rajeesh,
It is another good and shorter way, let me try by urs way, it'll save my time.
Thanks for help.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Thanks, your code helped me to include css file also, i was not able to include css file through cs by my code.
All i did is:
protected void Page_Init(object sender, EventArgs e)
{
Servicepath = "xmls/saltours/general/services.xml";
string jspath = "scripts/companyname/main.js";
String csname = "PageLoadScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl("~/" + jspath));
ClientScript.RegisterClientScriptBlock(typeof(PackageList), "one", "<link href="\"styles/companyname/style.css\"" type="\"text/css\"" rel="\"Stylesheet\"" />");
ClientScript.RegisterClientScriptBlock(typeof(PackageList), "two", "<link href="\"styles/companyname/st_home.css\"" type="\"text/css\"" rel="\"Stylesheet\"" />");
}
and I got what was required....
Thanks,
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
Dont bother for this question friends, i have solved it myself. all i did is:
string jspath = "scripts/" + this.company + "/main.js";
String csname = "PageLoadScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl("~/" + jspath));
Thanks friends and use this if any one is faciong this problem.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
just rember one more thing, when you have AJAX on that page you have to use ScriptManager, insted of ClientScriptManager
cheers,
Abhijit
|
|
|
|
|
Thanks buddy
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
how do i use this by using system.web.mail
or
system.net.mail;
any code sniptte that will help
please give me .
thanks in advance
|
|
|
|
|
Well, as your question is somewhat obscure, try google.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
what is this
Cheers!!
Brij
|
|
|
|
|
Dont SPAMing This Site
cheers,
Abhijit
|
|
|
|
|
I have to make an application similar to google calender.can any one help me how to do this.
the problem is I am unable to display a empty gridview
modified on Tuesday, October 14, 2008 6:39 AM
|
|
|
|
|
raghvendrapanda wrote: can any one help me how to do this.
Have you tried Google?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
use table rather than GridView,we have made a similar application using table itself.
cheers,
Abhijit
|
|
|
|
|
One thing,You can use google calendar it is free.if you want to make a own custom calendar use Exchange Server and the custom application
Cheers!!
Brij
|
|
|
|
|
can you describe your problem in nit detail n specifocally
Cheers!!
Brij
|
|
|
|
|
After loging into gmail>more>calender
in this page there is a canender control and a gridview like control. in grid view like control we can set our events on click event at every one hour interval.
I have to make this.
please help.
|
|
|
|
|
|
Hi All,
I need to implement the locking mechanism in my use case, I don't now how many ways to
achieve locking in ADO.Net to resolve the concurrency issues.
Thanks for advance reply..
Thanks,
Ranga
|
|
|
|
|
|
Hey guys,
as you may have noticed while reading this precisive title, I don't know where to get started with my problem. Any search has been unsuccessful so far, most likely because I don't know what to search for!
I would like to restrict the list of possible child elements within a control. To clarify this statement: I want the same behaviour for self-written webserver controls as it is for microsofts Table, TableRow and TableCell class.
It would be great, if a specific control is ONLY visible within another specific control.
Let me show you some example markup to illustrate what I just wrote:
<... some other markup ...>
<mcl:MyParentControl>
<!-- MyChildControl is ONLY visible right here, inside the MyParentControl -->
<mcl:MyChildControl />
</mcl:MyParentControl>
<!-- MyChildControl is NOT visible here, because we're outside the MyParentControl -->
<... some other markup ...>
As already mentioned, I don't even know where to get started, so it would be great if someone could push me in the right direction (I really don't need a working complete solution).
EDIT: Well, I should have written that I already figured out, how to make the MyChildControl appear in the MyParentControl (as the only control available).
I did this, by adding some attributes (ParseChildren, PersistChildren) to the MyParentControl class and set its Property ChildControls ( List<MyChildControl> ) to the inner default property of the control.
I now need MyChildControl NOT to appear outside of MyParentControl.
Thanks in advance!
modified on Tuesday, October 14, 2008 4:52 AM
|
|
|
|
|
Just for your interest:
You can realize such a behaviour by implementing a control builder for the control whichs child types should be restricted. It goes like this:
1. You derive a class from System.Web.UI.ControlBuilder (e.g. MyControlBuilder)
2. Now you have to assign the ControlBuilderAttribute to the control class and pass the type of MyControlBuilder to the attributes constructor
3. You implement/override the appropriate methods inside MyControlBuilder (which could be GetChildControlType and so on).
4. You are happy now!
Regards
mik
|
|
|
|
|
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
What to do
thanks in advance
|
|
|
|
|
Still this question is incomplete and it is quite tough to tell you because of what you are getting this error. You need to give the code which is producing this error.
Apurva Kaushal
|
|
|
|