I have linkButton:
<asp:LinkButton ID="lnkAddMedia" runat="server" CausesValidation="false"
Text="ADD media"></asp:LinkButton>
In code behind file(c#) I add a client script to this link button:
lnkAddMedia.OnClientClick="vbscript:selectMedia('1 ')";
When page is rendered, the rendered code is:
<a onclick="vbscript:selectMedia('1');"
id="ctl00_ContentPlaceHolder1_lnkAddMedia"
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$lnkAddMedia','')">ADD
media</a>
and I get script error message on the page:
error: Expected end of statement
I guess that error is because of semicolon, which is added to my script:
vbscript:selectMedia('1');
(vbSCript doesn't have semicolons).
This semi colon was added automatically. How can I remove that?
One way is to put javascript instead of vbscript, but I preffer programming
in vbscript, because I have all program written in this language.
Thank you for your answers,
Simon 2 1856
Why not use:
lnkaddmedia.attributes.add("onclick","vbscript :sel ectMedia(1)")
That shouldn't do any special formatting.
----
700cb Development, Inc. http://www.700cb.net
..NET utilities, developer tools,
and enterprise solutions
"Simon" <si*********@studio-moderna.com> wrote in
news:uX**************@TK2MSFTNGP14.phx.gbl: I have linkButton: <asp:LinkButton ID="lnkAddMedia" runat="server" CausesValidation="false" Text="ADD media"></asp:LinkButton>
In code behind file(c#) I add a client script to this link button: lnkAddMedia.OnClientClick="vbscript:selectMedia('1 ')";
When page is rendered, the rendered code is:
<a onclick="vbscript:selectMedia('1');" id="ctl00_ContentPlaceHolder1_lnkAddMedia" href="javascript:__doPostBack('ctl00$ContentPlaceH older1$lnkAddMedia',' ')">ADD media</a>
and I get script error message on the page: error: Expected end of statement
I guess that error is because of semicolon, which is added to my script: vbscript:selectMedia('1'); (vbSCript doesn't have semicolons).
This semi colon was added automatically. How can I remove that?
One way is to put javascript instead of vbscript, but I preffer programming in vbscript, because I have all program written in this language.
Thank you for your answers, Simon
--
Hi,
"lnkaddmedia.attributes.add" is obsolete - that is massage given by new
visual studio 2005.
So I use "lnkAddMedia.OnClientClick" - that is recomended method by VS2005.
But no matter which method I use, I always get the semicolon when the page
is rendered.
I don't know why?
So I rewrite my function to javascript but still I would like to know the
reason.
I have the latest Visual studio 2005 version: 8.0.50727.42, asp.net version:
2.0.50727 and project is in C# language.
Any idea?
Regards,S
"cbDevelopment" <de*****@remove.700cb.net> wrote in message
news:Xn***************************@207.46.248.16.. . Why not use:
lnkaddmedia.attributes.add("onclick","vbscript:sel ectMedia(1)")
That shouldn't do any special formatting.
---- 700cb Development, Inc. http://www.700cb.net .NET utilities, developer tools, and enterprise solutions
"Simon" <si*********@studio-moderna.com> wrote in news:uX**************@TK2MSFTNGP14.phx.gbl:
I have linkButton: <asp:LinkButton ID="lnkAddMedia" runat="server" CausesValidation="false" Text="ADD media"></asp:LinkButton>
In code behind file(c#) I add a client script to this link button: lnkAddMedia.OnClientClick="vbscript:selectMedia('1 ')";
When page is rendered, the rendered code is:
<a onclick="vbscript:selectMedia('1');" id="ctl00_ContentPlaceHolder1_lnkAddMedia" href="javascript:__doPostBack('ctl00$ContentPlaceH older1$lnkAddMedia',' ')">ADD media</a>
and I get script error message on the page: error: Expected end of statement
I guess that error is because of semicolon, which is added to my script: vbscript:selectMedia('1'); (vbSCript doesn't have semicolons).
This semi colon was added automatically. How can I remove that?
One way is to put javascript instead of vbscript, but I preffer programming in vbscript, because I have all program written in this language.
Thank you for your answers, Simon -- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: news.btinternnet.com |
last post by:
I can do this in IE
myLink.click(); //Invoking the handler as if the user had clicked on the
link themselves.
I need to be able to do the same in Netscape Navigator,
can anyone help ?
|
by: ravey |
last post by:
I would like to use a Form "button" (or "input", either one) within an
anchor, instead of using text or creating a graphic. This works fine
in all browsers but IE, but IE, while showing the...
|
by: Mike Woinoski |
last post by:
(I'm new to VS, so please forgive me if this is a faq.) I'm writing some Java
web services and need to test them with C++ clients. I can use either a Windows
Form application or an MFC application....
|
by: simon |
last post by:
On code behind file:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim ctrl As New LinkButton
ctrl.ID =...
|
by: John M |
last post by:
Hello,
In Visual studio .NET 2003,
On datagrid object :
How can I link the button element : edit, to do a some client events (such
as message box,
and do another event just after that to the...
|
by: Sean M. Loftus |
last post by:
I have a need to call an html page into the pane I'm viewing using a button
on an ASP page. The page itself is an ASP page called from a website. I know
a link would work but the rest of the page...
|
by: JJ |
last post by:
I have an app and on one page I have Link buttons that will fire up a
word doc or at least thats my goal. When someone clicks on a link
button I need to find a word doc on server where app resides....
|
by: kschneider |
last post by:
Assume there's a form with it's action attribute all set to post to a
URL, but without a submit control. Form submission is done via a link
and I want to prevent the classic "double submit"....
|
by: Julia |
last post by:
Hi
I have a webcontrol.button on a asp.net page. When the user clicks the
button I would like to dynamically build a link with values from the config
file and then open this link.
I know how...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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...
| |