473,811 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Javascript in c# for webpart

1 New Member
Hi,
My question on custom webpart creation in c#.
One quick question, can you please tell me the syntax or step to call the java script from Output.write(<a href=.....)
SCENARIO: click here should act as a link. And the link should invoke javascript.

for eg:
output.Write("< a href="#"" onclick="javasc ript:validateSu bmit();" ">" Click here "</a>");

Here Im getting following errors on compilation
1. "Preprocessor directives must appear as the first non-whitespace character on a line"
2. ; expected
3. ) expected

Hope the syntax is wrong....

Javascript is written as
output.Write ("<script>funct ion validateSubmit( ){alert ('Hi!, Javascript Invoked');}</script>");

Please help me out.

Very thanks in advance
Nov 26 '07 #1
0 1253

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1599
by: ALI-R | last post by:
Hi All, I have a webservice on a win 2003 server and I'm trying to call it from another win2003 server which is hosting my sharepoint portal server. I am trying to call that webservice from a webpart but I get this error which says : System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at RSTreeWebPart.RSTree.reportsList() at RSTreeWebPart.RSTree.RenderWebPart(HtmlTextWriter output)
0
1211
by: J. Jespersen | last post by:
Hi people, I fiddling with webparts, and have created my own custom webpart from scratch. The webpart itself is contained in a myPart.dll I have two different sites. SiteA and SiteB. Both are webparts-based. I have added the webpart to my toolbox, and added it to a declarativeCatalogPart, and finally added the webpart to a webPartZone. No problemo. I have allowed the webpart for export, and have exported it to a
3
4746
by: DexHex | last post by:
Hi, I am stumpt. Is there anyway to set the background image on a webpart title?
0
1046
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then te user logs off, next time he logs on he will find the webpart already open. Now, if a different user logs on, the fact that another user might have opeed a webpart should not affect the page. For him the page should only show webparts that were open inside his session. So this is...
2
1655
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then the user logs off, next time he logs on he will find the webpart already open. Now, if a different user logs on, the fact that another user might have opened a webpart should not affect the page. For him the page should only show webparts that were open inside his session. This is...
3
1733
by: Jav | last post by:
I create a UserControl (.ascx), and then change it in code to: Inherits System.Web.UI.WebControls.WebParts.WebPart expecting that it will now be treated as a WebPart. But this immediately generates 2 errors. How does one go about creating a WebPart by inheriting as above? (I know that I can drag a UserControl into a WebPartZone and it will be wrapped in a GenericWebPart.) Thanks Jav
2
1363
by: MrCrool | last post by:
Hi I am trying to develop WebParts that will interact with each other to make up a highly customizable "system", but I am having trouble with the order in which the webparts connect and communicate. If you have a WebPart that is both consumer and provider it is most likely the "middle" component in your communication: It receives a value from it's provider, uses this value for some purpose, and sends it's own value on to the consumer...
4
1552
by: Arnab das | last post by:
I am working in asp.net webpart.I want to show the delete warning message in a modal popup. How can I achieve this?
1
4059
by: Ashish P K | last post by:
I have a .Net Application(64 bit) calling a 32 bit COM+. What is the best way to achieve this? Basically I have got a webpart dll, which is compiled for any CPU and IIS running on 64 bit. All the webparts works fine but the webpart which are accessing legacy COM+ methods fails to get loaded. To test this further I created a small DotNet Sample App which loads COM+method. If the Sample app is comiled for 32 everything works on 64 bit...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10652
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10137
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7673
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4346
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.