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


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

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

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
 
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).


View Complete Post


More Related Resource Links

upload file not working

  

Hi,

iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.




New off line application working with sdf file. Need advice

  

Hey Folks


I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.


Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's


Thanks

Capjlp



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


Code write file asp.net 2.0 is working in firefox but IE not working.

  
If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   

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.

Drag drop functinality not working on Explore View control for file containing special characters in

  
We have created a control which uses explorer view control for file drag and drop. This functinality works fine for a file having filename without special characters but it gives an error if we drag and drop a file having special characters in the file name. The reason for this is Sharepoint uses WebDAV protocol for file transfer to the Sharepoint document library and WebDAV protocol has limitation that it does'nt accept file with special characters. Please let me know the way how I can accomplish drag and drop of file with special characters in file name, onto Explorer View control with WebDAV.

Drag drop functinality not working on Explore View control for file containing special characters in

  
We have created a control which uses explorer view control for file drag and drop. This functinality works fine for a file having filename without special characters but it gives an error if we drag and drop a file having special characters in the file name. The reason for this is Sharepoint uses WebDAV protocol for file transfer to the Sharepoint document library and WebDAV protocol has limitation that it does'nt accept file with special characters. Please let me know the way how I can accomplish drag and drop of file with special characters in file name, onto Explorer View control with WebDAV.

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

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

Task scheduler and System.IO.File.WriteAllText() not working properly

  
I have a simple console application that has this in mainline:  Console.WriteLine(System.String.Format("the current directory is: {0}", System.IO.Directory.GetCurrentDirectory())); System.IO. File.WriteAllText(@"test.txt", "new contents");   Console.ReadLine(); I compile this in VS 2010 and copy the EXE to a directory named "c:\test".  When I run this code in two different OS's via "Task Scheduler" and "Scheduled Task" I get different results.   In Windows Server 2003 R2 "Scheduled Task" this code will create a file as I would expect, c:\test\test.txt with the proper contents written to it.  When I run this same code on Windows 2008 R2 (64 bit version) "Task Scheduler" it writes the expected contents to an unexpected location, c:\C:\Windows\SysWOW64\test.txt. In both environments if I run the exe's from a command line, it writes to c:\test\test.txt as I would expect. As I understand it, if you don't fully qualify the file name in the first parameter of the WriteAllText method it will write the contents to the file in the directory of the executable however this seems to break down when running in the Windows 2008 Task Scheduler.  I know I can fully qualify the file name or put the expected path in a

.js file not working

  
I have page calling javascript. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Java Script Test</title> <script language="javaScript" type="text/javascript" src="javaScript/TestScript.js"></script> </head> <body> <form id="form1" runat="server"> <div align="center"> <p><asp:Label ID="Label1" runat="server" Text="PayBand"></asp:Label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="txtpb" runat="server" onkeyup="insideJS('txtpb','txtGP','txtgross');"></asp:TextBox></p> <p><asp:Label ID="Label3" runat="server" Text="Grade Pay"></asp:Label> &nbsp;&nbsp;&nbsp; <asp:TextBox ID="txtGP" runat="server" onkeyup="insideJS('txtpb','txtGP','txtgross');"></asp:TextBox></p> <p><asp:Label ID="Label2" runat="server" Text="gross"></asp:Label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="txtgross" runat="serv

File Upload Control is not working in Update Panel

  
hi friend... i am using update panel... in one of my aspx page (ASP.NET 2.0)there is a file upload control in update panel which is used to upload company logo on server..when i remove the update panel.. than file upload is working properly..but when i again place an update panel then file upload control is not working and its giving me error.. in likeIf String.IsNullOrEmpty(fldLogo.PostedFile.FileName.ToString) Then                 as object reference not set to an instance of an object... can any body help me ?any idea ??  

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

File download from 3 servers not working.

  

Hi guys,

We have a problem where in the user can download files from an email. A link that will redirect to a page where the code to download the file resides. Before the download the user needs to be logged in to the system for security. The problem is that sometimes for whatever reason when the user clicks the link the download dialog box does not appear and just a blank white page. It happens only on our staging environment where we have 3 servers.. We can't reproduce this in our dev and test env. where we only have one server.

We need help.. thanks.

Below is the actual code.

  Private Sub DownloadFile()
        Dim path As String = ConfigurationManager.AppSettings("JobApplicationDocuments")
        path &= applicationClientId & "\" & jobId & "\" & jobApplicationId & "\" & fileName

        If (System.IO.File.Exists(path)) Then
            Dim fs As System.IO.FileStream = System.IO.File.OpenRead(path)
            Dim file As System.IO.FileInfo = New System.IO.FileInfo(path)
            If file.Exists Then
                Response.Clear()
                Response.AddHeader("Content-Disposition", "attachment; filename=" & orginalFileName.Replace(" ", "_"))
                Response.AddHeader("Cont

ASP.net Website - Styles and Java script not working on Mozilla firefox

  

Hello,

       I developed a ASP.NET website. The style sheets are loading and the site is working well on Internet explorer. But When I open in Mozilla firefox/ google chorme The sytle sheets doesnt work and the javascript also doesnt work. I am not sure what to do to make my website compatible with firefox/chrome. Can someone tell me what needs to changed or where the problem usually arises in this kind of scenarios?

Thanks,

Nag


Emergency Help! Page working but suddenly doesnt!

  

Hey, I have a severe problem. This code was working not 3 hours ago and has been for days, and suddenly it stopped.

Here's the web page code:

<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Main.aspx.vb" Inherits="Members_Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 51%;
        }
        .style4
        {
            width: 50%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:LoginView ID="LoginViewMembersOnly" runat="server">
    <LoggedInTemplate>
         <h2> Member Control Panel</h2>
                    <table border="0" runat="server" id="MemberTables">
                        <tr>
                            <td class="style4" valign="top" runat="server" id="MemberProfDiv">
                            <div class="MemberProfile" runat="server" id="MemberP

Clarification on how to include script file

  

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.




System.IO.File.Exists - Not working

  
I Hide/Show an image based on the existence or not of that image. If the image exists, then I show the image the report has to show. If the image does not exist, then I show a default image. Think of it as an eCommerce web site which shows a catalogue of products. If we do have a picture for that product, then we show the product's picture. If we do not have a picture for that product, then we show a default images that says image not available.

To achieve this, I tried to use System.IO.File.Exists("image path") in the Hidden property of the image field but it does not work.

I thought it could be the due to the location of the image but I also moved the image to my local machine where I am designing this report and it still fails.

I created a very simple console project just to see if the library works and it does, when I run the code on a console application, it perfectly works, it returns True.

I also modified rssrvpolicy.config changing all PermissionSetName to FullTrust and still nothing.

I will really appreciate any possible solution, links, ideas, comments...

Thanks in advance for your help.

Miguel Gonzalez.
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