473,395 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

javascript in an .ascx file

I am trying to put javascript in an .ascx file. Although it seems to work
no compile errors the button does nothing.

This is what I have. In my grid a template column. Then above in the .ascx
file I have the javascript. Now I have created an html page with the
javascript to make sure nothing was wrong. It ran fine. Any idea's what I
am doing wrong?

Code is below.

TIA,
Brett

<asp:TemplateColumn HeaderText="E-Mail Proposal"
ItemStyle-HorizontalAlign="Center">

<ItemTemplate>

<input type="button" name="email" value= "EMail"
onclick="OpenOutlookDoc('IPM.Note.FormA')" />

</ItemTemplate>

</asp:TemplateColumn>

function OpenOutlookDoc(whatform)

{

try

{

// Variable Definitions

var nameSpace = null;

var mailFolder = null;

var mailItem = null;

var tempDoc = null;

var outlookApp = null;

var filename = null;

var file = null;

file = 'c:\\test.txt';

filename = 'myfile';

outlookApp = new ActiveXObject("Outlook.Application");

nameSpace = outlookApp.getNameSpace("MAPI");

mailFolder = nameSpace.getDefaultFolder(6);

mailItem = mailFolder.Items.add(whatform);

mailItem.To = "br*********@test.com";

mailItem.Subject = 'test subject';

mailItem.Body = 'test body';

mailItem.Attachments.Add(file);

mailItem.Display(0)

}

catch(e)

{

// act on any error that you get

}

}

</script>
May 22 '07 #1
0 1575

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthew Nace | last post by:
Is there any limitations in using javascript in .ascx files (user controls) I got it working just fine but some of the properties for objects, ie form.item property isn't coming up. In .aspx files...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
0
by: rockdale | last post by:
I have an aspx file and a placeholder to dynamic load user defined webcontrols (ascx) in one one my user defined webcontrols, I need to call functions in my js file. I put the following line in...
0
by: acadam | last post by:
Hi, I have an userControl .ascx with a gridView control. One of the columns is a TemplateField with an HyperLink control. On the Row_DataBound event, I am checking that one of the other columns...
2
by: Altman | last post by:
I have created an ascx control and I am calling registerclientscriptblock. The path to the js file is relative to the aspx page and not the ascx file. The function runs fine in IE7 but in...
0
by: mpl | last post by:
Hi, i have an ascx file haivng code like <asp:LinkButton ID="col" runat="server" Text='<%# Eval("8Y") %>' OnClick="ColSelected" /> now i am using code behind implmentation for ColSelected.I...
7
by: mpl | last post by:
Hi, i have an ascx file(web control file ) haivng code like <asp:LinkButton ID="col" runat="server" Text='<%# Eval("8Y") %>' OnClick="ColSelected" /> now i am using code behind implmentation...
2
by: mpl | last post by:
Hi, i have an ascx file named mytestcontrol.ascx. it has reference to another ascx control as below. <%@ Register Src="myControl.ascx" TagName="myControl" TagPrefix="uc" %> .... .........
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.