473,394 Members | 1,794 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,394 software developers and data experts.

Weird LinkButton!

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.

I have added the linkbutton control in my datagrid and it rendered perfectly
but whenever i clicked the linkbutton am getting this error

'event' is null or not an object.

I have checked with all the possibilities like using aspnet_regiis -i and
aspnet_regiis -c etc., and all my other controls like button, hyperlink and
all my javascripts work fine.

I have used Scott Mitchell's skmlinkbutton, so i thought that would be
having some problem, so i removed that control and put microsoft's built in
linkbutton control and for my surprise am getting the same error. i checked
with the rendered javascript function which is in the following format.
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl6:nln Delete", "", true, "", "",
false, true))

i didnt understand what this script says(i mean parameters) and i compared
with some other script and found the target page is not rendered. but still
i couldnt able to find out the exact reason for this error. can anyone
please do help to solve this issue coz my whole project got stuck because of
this simple javascript error.

Microsoft guys please do help me!.

Thanks in advance,
Shiva.
Nov 20 '05 #1
6 4232
Are you running the Item event of the datagrid using a CommandName or the
click event on the link button?

One trouble shooting step could be re-adding the link button.

--
Jay Douglas
http://www.jaydouglas.com
"Shivakumar" <sh***@novantus.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

I have added the linkbutton control in my datagrid and it rendered
perfectly but whenever i clicked the linkbutton am getting this error

'event' is null or not an object.

I have checked with all the possibilities like using aspnet_regiis -i and
aspnet_regiis -c etc., and all my other controls like button, hyperlink
and all my javascripts work fine.

I have used Scott Mitchell's skmlinkbutton, so i thought that would be
having some problem, so i removed that control and put microsoft's built
in linkbutton control and for my surprise am getting the same error. i
checked with the rendered javascript function which is in the following
format.
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl6:nln Delete", "", true, "",
"", false, true))

i didnt understand what this script says(i mean parameters) and i compared
with some other script and found the target page is not rendered. but
still i couldnt able to find out the exact reason for this error. can
anyone please do help to solve this issue coz my whole project got stuck
because of this simple javascript error.

Microsoft guys please do help me!.

Thanks in advance,
Shiva.

Nov 20 '05 #2
jay,
Am using the command name of the datagrid.
<asp:LinkButton runat="server" ForeColor="#FF6633" Text='Publish'
ID="Linkbutton1" NAME="Label1" CommandName="Edit" CommandArgument='<%#
GetURL(Container,"Publish") %>'></asp:LinkButton>

GetURL has the following
--------------------------
case "Publish":

if( (DataBinder.Eval(Container, "DataItem.StatusCode")).ToString()=="100")

URL="Publish"+"|"+DataBinder.Eval(Container, "DataItem.ModuleID");

break;
and the edit command has the following code.
------------------------------------------------
protected void dgScreenDetails_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)

{

string splitString = e.CommandArgument.ToString();

string[] arrCommandArgument = splitString.Split('|');

if (arrCommandArgument[0].ToString() == "Publish")

{

ModuleListingGeneralFunctions.PublishModule(arrCom mandArgument[1].ToString());

BindDataToGrid();

}

}

NB: this code works fine when run in the local machine but throws javascript
error only when accessed from some other machine

Regards,

Shiva.
"Jay Douglas" <ja****************@jaydouglas.com> wrote in message
news:O0**************@TK2MSFTNGP15.phx.gbl...
Are you running the Item event of the datagrid using a CommandName or the
click event on the link button?

One trouble shooting step could be re-adding the link button.

--
Jay Douglas
http://www.jaydouglas.com
"Shivakumar" <sh***@novantus.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

I have added the linkbutton control in my datagrid and it rendered
perfectly but whenever i clicked the linkbutton am getting this error

'event' is null or not an object.

I have checked with all the possibilities like using aspnet_regiis -i and
aspnet_regiis -c etc., and all my other controls like button, hyperlink
and all my javascripts work fine.

I have used Scott Mitchell's skmlinkbutton, so i thought that would be
having some problem, so i removed that control and put microsoft's built
in linkbutton control and for my surprise am getting the same error. i
checked with the rendered javascript function which is in the following
format.
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl6:nln Delete", "", true, "",
"", false, true))

i didnt understand what this script says(i mean parameters) and i
compared with some other script and found the target page is not
rendered. but still i couldnt able to find out the exact reason for this
error. can anyone please do help to solve this issue coz my whole project
got stuck because of this simple javascript error.

Microsoft guys please do help me!.

Thanks in advance,
Shiva.


Nov 20 '05 #3
Does the /wwwroot folder have the 2.0 aspnet_client javascript?

--
Jay Douglas
http://www.jaydouglas.com
"Shivakumar" <sh***@novantus.com> wrote in message
news:u$**************@TK2MSFTNGP14.phx.gbl...
jay,
Am using the command name of the datagrid.
<asp:LinkButton runat="server" ForeColor="#FF6633" Text='Publish'
ID="Linkbutton1" NAME="Label1" CommandName="Edit" CommandArgument='<%#
GetURL(Container,"Publish") %>'></asp:LinkButton>

GetURL has the following
--------------------------
case "Publish":

if( (DataBinder.Eval(Container, "DataItem.StatusCode")).ToString()=="100")

URL="Publish"+"|"+DataBinder.Eval(Container, "DataItem.ModuleID");

break;
and the edit command has the following code.
------------------------------------------------
protected void dgScreenDetails_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)

{

string splitString = e.CommandArgument.ToString();

string[] arrCommandArgument = splitString.Split('|');

if (arrCommandArgument[0].ToString() == "Publish")

{

ModuleListingGeneralFunctions.PublishModule(arrCom mandArgument[1].ToString());

BindDataToGrid();

}

}

NB: this code works fine when run in the local machine but throws
javascript error only when accessed from some other machine

Regards,

Shiva.
"Jay Douglas" <ja****************@jaydouglas.com> wrote in message
news:O0**************@TK2MSFTNGP15.phx.gbl...
Are you running the Item event of the datagrid using a CommandName or the
click event on the link button?

One trouble shooting step could be re-adding the link button.

--
Jay Douglas
http://www.jaydouglas.com
"Shivakumar" <sh***@novantus.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

I have added the linkbutton control in my datagrid and it rendered
perfectly but whenever i clicked the linkbutton am getting this error

'event' is null or not an object.

I have checked with all the possibilities like using aspnet_regiis -i
and aspnet_regiis -c etc., and all my other controls like button,
hyperlink and all my javascripts work fine.

I have used Scott Mitchell's skmlinkbutton, so i thought that would be
having some problem, so i removed that control and put microsoft's built
in linkbutton control and for my surprise am getting the same error. i
checked with the rendered javascript function which is in the following
format.
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl6:nln Delete", "", true, "",
"", false, true))

i didnt understand what this script says(i mean parameters) and i
compared with some other script and found the target page is not
rendered. but still i couldnt able to find out the exact reason for this
error. can anyone please do help to solve this issue coz my whole
project got stuck because of this simple javascript error.

Microsoft guys please do help me!.

Thanks in advance,
Shiva.



Nov 20 '05 #4
you should enable script debugging (advanced options in ie), and track down
the actual script error. unfortunately vs2005 generates its javascript on
the fly rather then using script files, so if its a coding error you will
need a hotfix.

-- bruce (sqlwork.com)


"Shivakumar" <sh***@novantus.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

I have added the linkbutton control in my datagrid and it rendered
perfectly but whenever i clicked the linkbutton am getting this error

'event' is null or not an object.

I have checked with all the possibilities like using aspnet_regiis -i and
aspnet_regiis -c etc., and all my other controls like button, hyperlink
and all my javascripts work fine.

I have used Scott Mitchell's skmlinkbutton, so i thought that would be
having some problem, so i removed that control and put microsoft's built
in linkbutton control and for my surprise am getting the same error. i
checked with the rendered javascript function which is in the following
format.
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl6:nln Delete", "", true, "",
"", false, true))

i didnt understand what this script says(i mean parameters) and i compared
with some other script and found the target page is not rendered. but
still i couldnt able to find out the exact reason for this error. can
anyone please do help to solve this issue coz my whole project got stuck
because of this simple javascript error.

Microsoft guys please do help me!.

Thanks in advance,
Shiva.

Nov 20 '05 #5
I did bruce and its telling the following line got error ( 'event' is
null or not an object)

<a id="dgScreenDetails__ctl5_Linkbutton1" NAME="Label1"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("dgScreenDetails:_ctl5:Lin kbutton1", "", true,
"", "", false, true))"

i couldnt parse this function, can u explain me if you know?

Regards,
Shiva

Nov 20 '05 #6
Hi all,
I myself found the error at last and fixed! it was problem
with WebUIValidation .js file. Thank you guys for trying to help me
out.

Regards,
Shiva

Nov 21 '05 #7

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

Similar topics

5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
1
by: Constandinos | last post by:
Hi I have a very weird problem and very difficult to solve. There is a solution that I already know, but that is too time consuming and I need a quick answer if there is one I have a big...
0
by: Solomon Shaffer | last post by:
This is very interesting - and odd. I have a number of LinkButtons that are created in a custom data grid that I created. The purpose of the LinkButtons is to provide alphabetical filtering...
3
by: MRW | last post by:
I have a simple linkbutton and a function when it's clicked. It works perfectly in a regular .aspx page. However, when I place it inside the ContentPlaceHolder, it no longer works. It does...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
3
by: rn5a | last post by:
Consider the following code which creates LinkButtons dynamically: For i = 1 to 5 lnkBut = New LinkButton lnkBut.ID = "lnkBut" & i lnkBut.Text = i.ToString & " " lnkBut.CommandName = i...
0
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The...
3
by: =?Utf-8?B?dmluY2VudHc1Ng==?= | last post by:
I have an ASP.NET 2.0 application. It is pretty basic. What it does is shows a gridview of data from a stored procedure. The user can also select a date filter. The problem is that sometimes an...
5
by: Peter Larsen [CPH] | last post by:
Hi, The following sample shows a LinkButton in the HeaderTemplate of a Repeater control. The problem is that i'm not able to access the linkbutton in code (in the cs file) as long as the...
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...
0
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.