.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Clarification on how to include script file

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net
 

It took me a while to realize the following, which was generated by VS after dragging and dropping the script file to a view file,  does not work

 <script src="../../Scripts/jquery.foo.min.js" type="text/javascript"></script>

Instead, the following works:

<script type="text/javascript" src="<%: Url.Content("~/Scripts/jquery.foo.min.js") %>"></script>


However, the former works perfectly for another view file. I am wondering if any expert could shed some light on this.

My current hunch is the correct path without using helper Url.Content() depends on a page's URl not where the view file is located.






View Complete Post


More Related Resource Links

File Upload to an .ashx Script.

  

Hoping that someone can help me with this. I've been tearing my hair out for days looking for sources and coming up with nothing.

Basically, the scenario is this: I'm working on a project whereby an iPhone will make an HTTP-POST call to an .ashx file on my site. The POST will consist of some fields and a file.

I'm having difficulty - read that as no luck what-so-ever - in finding the form fields or the file when I look at the HTTPContext object in the debug mode of Visual Studio. And if I look at HTTPContext.Request.Files.Count (where I would expect to find a file count) the value is always zero!!

Please help, very confused by this!

 

peter


Powershell script to copy a list attachment to a file

  
I have a script that builds a list of items.  I'd like to add the ability to download the list items' attachments to a local directory.  IS this possible?  There are lots of examples of how to add attachments but nothing that can download the attachments.  Any help would be appreciated.

how to check one time java script file download not every session

  
how to check one time java script file download not every session

How to include a javascript file in a custom action?

  
I need to call a custom javascript function from a ribbon button, how do I include the javascript file within the custom action solution in order that it will be properly referenced by the html output? I am not allowed to define a custom masterpage at this point. So what can I do?   Thanks, Stephan  

<%=%> doesnt working if script is in seperate js file.

  
var a =document.getElementById("<%= TextBoxId1.ClientID %>")this code soesnt working on a seperate javascript file (ofsure linked to aspx file)but works if javascript embedded in aspxwhat if my javascript code is not in aspx ?how can I access autonamed IDs like this ? any idea ?(thank you before any anwer).

JS script file path screwed up after deploying MVC application

  
Hi,  I am relatively new to MVC, after deploying my MVC application as per Haack http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx i seem to have got a new problem. My Jquery doesnt seem to get recognized. I get "object doesnt support this property or method " at this line "jQuery(document).ready(function() {" i have tried all sort of things including changing the js script file path to relative and absolute, setting base tag etc. Kindly advice if the above method of deploying is right and if that is what is causing the issue and if there is some other way to handle the .mvc requests.   Thanks and Regards, Muzammil Ahmed

WCF NetDispatcherFaultException - Throws exception only when I include file (List)

  

Hi All,

My service would return a file (List<byte> - use WSSF so dont know why it is a list rather than a byte array. When I consume the service it throws the following exception:

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://www.tempuri.org. The InnerException message was 'Error in line 1 position 1124. Expecting state 'Element'.. Encountered 'Text'  with name '', namespace ''. '.  Please see InnerException for more details."

Any ideas on how to fix it would be much appreciated.

Thanks,

Raja



Deploy and update script file with custom ribbon tab to Sharepoint Server 2010

  

Hey everyone,

currently I'm building a custom tab for Sharepoint Server 2010 and at the moment I'm stuck on the following issue,
with the first debug deployment Visual Studio sends the .js file that provides some functions for the ribbon elements from Scripts folder in the VS project
to Sharepoint Server.
However, it won't apply any changes I did on the script afterwards to the file on the server.
So the effect is, that as soon as I do the next debug, the previous script is being used by Sharepoint and the new version, containing the new code, is left aside.

It seems to me as if Visual Studio would only deploy the .js file just once and then rely to this copy, maybe there are some configuration settings to make, but after hours of research, I still can't figure out where things do go wrong or what configuration to apply to update the script on the server.
I couldn't locate the file on hdd either, even searched the whole fs but the results showed only the new script file.

Any help on this would be very much appreciated, this issue drives me nuts and consumes plenty of time ;)

Workaround at the moment: each time the script is changed, set up new project... :D

Greets, Norman

P.S: Yes, I did flush

SSIS Script Componet to change Flat File LF to CR LF

  

Hello,

I have a corrupt Flat File and I need to write a SSIS Script Component to Replace LF to CR LF in my flat file.

Any idea how to do it?

Thanks


Kajoo

Include Button Click Event in WPF Resource dictionary's CodeBehind file

  
I have 3 buttons as a part of menu in my MainWindow.xaml file.  
On click of these I have a Common Grid that gets populated with the
 data from my database. Now for these i have set various Control
 templates with 3 different keys for my 3 different options.

Coming to my main point. When I include Click events under my
 Gridview and compile, it doesn't let me to do so cause of error.
 And to overcome this i made use of a Code behind C# Class file for
 my resourcedictionary (styles.xaml) that is styles.xaml.cs.
I got this from http://stackoverflow.com/questions/92100/is-it-possible-to- set-code-behind-a-resource-dictionary-in-wpf-for-event-handling

But As soon as i follow all procedure mentioned at above link it
says me ... Error Message: 'X' does not contain a definition for 'show'
 and no extension method 'show' accepting a first argument of
type 'X' could be found (are you missing a using directive or an
assembl

Deploy and update script file with custom ribbon tab to Sharepoint Server 2010

  

Hey everyone,

currently I'm building a custom tab for Sharepoint Server 2010 and at the moment I'm stuck on the following issue,
with the first debug deployment Visual Studio sends the .js file that provides some functions for the ribbon elements from Scripts folder in the VS project
to Sharepoint Server.
However, it won't apply any changes I did on the script afterwards to the file on the server.
So the effect is, that as soon as I do the next debug, the previous script is being used by Sharepoint and the new version, containing the new code, is left aside.

It seems to me as if Visual Studio would only deploy the .js file just once and then rely to this copy, maybe there are some configuration settings to make, but after hours of research, I still can't figure out where things do go wrong or what configuration to apply to update the script on the server.
I couldn't locate the file on hdd either, even searched the whole fs but the results showed only the new script file.

Any help on this would be very much appreciated, this issue drives me nuts and consumes plenty of time ;)

Workaround at the moment: each time the script is changed, set up new project... :D

Greets, Norman

P.S: Yes, I did flush

Refreshing of Excel file not happening when used from a script task

  

Hello,

The below peice of code works fine when am executing it as a stand alone .net app. But when I copy paste the same code into a script task (SSIS) , The excel refreshing doesn't happen.


public class RefreshPivotTables
{


    public string DestinationFileName
    {
        get;
        set;
    }

    public string SourceTemplate
    {
        get;
        set;
    }

    public string ReprotName
    {
        get;
        set;
    }

    public RefreshPivotTables(string destinationFileName, string sourceTemplate, string reprotName)
    {
        this.DestinationFileName = destinationFileName;
        this.SourceTemplate = sourceTemplate;
        this.ReprotName = reprotName;
    }

    public void Refresh()
 &

Get latest file name using SSIS script task: Error while execution

  

Hi  , I am trying to get the latest file name to process files in SSIS using vb.net code . I did set the varible in the For each loop container and assigned the variable in my file connection. I have been receiving this error msg.: Please help me out.

Error: 0x2 at Get File Name: The script threw an exception: The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.

Task failed: Get File Name

Warning: 0x80019002 at Foreach Loop Container: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "testpackage.dtsx" finished: Failure.

Thanks,


How to include page.xaml file in existing .net 2.0 project

  

We have a existing web based project in Asp.net and would like to use third party silver light control in the same application.

We need a help how to include silverlight control and use .xaml to access.

Please help

 

 

 


How to execute sql script file in Sql Server 2008

  
want to execute a sql script file if user want to apply the new database changes. That script file is present on the server and if user wants to apply the new changes it just press a button i want to know how to execute that script file to a particular server database in Sql Server 2008. Im using C# for coding

SSIS - Script Task Error - Could not load file or assembly

  
Hello

I have script task that has references added to it but still giving me above error? How should i resolve this situation?


Thanks

File Splitter in .Net

  
I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend