473,320 Members | 2,024 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,320 software developers and data experts.

UserControl LinkButton Javascript Error

Hi All,

Ive just attempted to use a <ASP:LinkButton> on a ASCX
User Control. The .NET system produces the
HTML/Javascript that doesnt work...

Now before you all scream OnCommand, OnClick Event
Handlers etc. etc.. Or RTFM, I'm not stupid, been there,
done that, so please keep on reading... to the end...

Heres the .ascx file declaration
-----------------------------------------------------
<asp:LinkButton Runat="server" ID="lnk1"
OnClick="lnk1_OnClick">Hello</asp:LinkButton>

Here's what .NET produces as HTML for the browser
-----------------------------------------------------
<a id="MyBasket_lnk1" href="javascript:__doPostBack
('MyBasket$lnk1','')">Hello</a>

Even the form declaration is interesting...
<form name="MyBasket:frmBasket"

Now, this works beautifully on a single .ASPX page, but
the framework does special things to the naming of
objects when they're from an embedded user control.. and
this seems to stop the javascript from correctly
identifying the object involved.

[ <a id="MyBasket_lnk1" href="javascript:__doPostBack
('MyBasket$lnk1','')">Hello</a> ]

Note how the ID of the object and the ID passed into the
postback function are DIFFERENT??? So, my page gets a
Javascript Error "Object Expected". This is automatically
generated by .net for me, so theres NOTHING i can do
about it!!

Now, this strikes me as being a bug, if there is a work
around I love to know it, otherwise hopefully someone at
MS might want to acknowledge this bug.

Sorry for the pushy tone, but i get so tired of people
reading the first line, and then diluting the
conversation thread with rubbish comments.

Many thanks all,

Matt
Jul 21 '05 #1
0 1187

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

Similar topics

4
by: Rob Koch | last post by:
What's the best way to refresh a usercontrol using a parameter? My usercontrol is just a DataList that retrieves data from SQL in association with a public propterty. I click on a LinkButton in...
0
by: scott | last post by:
Ok....I'm really stumped on this one. I've got a webform with a usercontrol set in it. The usercontrol handles login and nav. things. In the UC(usercontrol) i have 3 textboxs and a label. The...
3
by: Iain | last post by:
Hi I have page (testCal.aspx) that contains a usercontrol (custCalendar.ascx) - see below signature for code. The UC contains a linkbutton which which when clicked, posts back and displays a...
0
by: Colin Ramsay | last post by:
Hi all, I don't normally post swathes of code like this but I am truly banging my head off my desk here... I've dynamically created a datagrid within a usercontrol. There are two columns...
3
by: Eric | last post by:
I am getting a strange error on one of my pages using Linkbuttons. The linkbutton works once. After the page is posted, I get a strange JavaScript error: "Error: 'undefined' is null or not an...
5
by: comshiva | last post by:
Hi all, I have converted my existing ASP.NET project from 1.1 to 2.0 and i have found that everything works fine except the linkbutton control in my datagrid which throws an javascript error when...
6
by: Shivakumar | last post by:
Hi all, Recently i have updated my vs.net 2003 project to vs.net 2005 and i have successfully converted my code and found no problem with all my controls except the one which is the linkbutton. ...
0
by: Matt Law | last post by:
Hi All, Ive just attempted to use a <ASP:LinkButton> on a ASCX User Control. The .NET system produces the HTML/Javascript that doesnt work... Now before you all scream OnCommand, OnClick...
1
by: =?Utf-8?B?S3lsZSBNLiBCdXJucw==?= | last post by:
I have a set of controls and logic that must be invoked from several pages within a web application as a popup dialog, so I intend to use a userControl contained in a panel extended with the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.