Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Weird LinkButton!

 
Thread Tools Search this Thread
Old 11-16-2005, 03:46 PM   #1
Default 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.




Shivakumar
  Reply With Quote
Old 11-16-2005, 04:22 PM   #2
Jay Douglas
 
Posts: n/a
Default Re: Weird LinkButton!
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" <> wrote in message
news:%...
> 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.
>
>





Jay Douglas
  Reply With Quote
Old 11-16-2005, 04:35 PM   #3
Shivakumar
 
Posts: n/a
Default Re: Weird LinkButton!
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" <> wrote in message
news:...
> 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" <> wrote in message
> news:%...
>> 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.
>>
>>

>
>





Shivakumar
  Reply With Quote
Old 11-16-2005, 05:12 PM   #4
Jay Douglas
 
Posts: n/a
Default Re: Weird LinkButton!
Does the /wwwroot folder have the 2.0 aspnet_client javascript?

--
Jay Douglas
http://www.jaydouglas.com


"Shivakumar" <> wrote in message
news:u$...
> 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" <> wrote in message
> news:...
>> 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" <> wrote in message
>> news:%...
>>> 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.
>>>
>>>

>>
>>

>
>





Jay Douglas
  Reply With Quote
Old 11-16-2005, 05:17 PM   #5
Bruce Barker
 
Posts: n/a
Default Re: Weird LinkButton!
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" <> wrote in message
news:%...
> 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.
>
>





Bruce Barker
  Reply With Quote
Old 11-16-2005, 09:12 PM   #6
comzy
 
Posts: n/a
Default Re: Weird LinkButton!
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



comzy
  Reply With Quote
Old 11-21-2005, 06:09 AM   #7
comzy
 
Posts: n/a
Default Re: Weird LinkButton!
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



comzy
  Reply With Quote
Old 03-28-2008, 11:45 AM   #8
Needhi
Junior Member
 
Join Date: Mar 2008
Posts: 2
Unhappy same problem in linkbutton
Hi
Can u tell me how u solved this problem of linkbutton. What did u do in WebUIValidation.js file. As i m also facing same problem.


Needhi
Needhi is offline   Reply With Quote
Old 06-04-2008, 07:34 PM   #9
lnong
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default
Hi,

Has any of you been able to figure out and solve this problem with the WebUIValidation.js error. I'm experiencing the same problem right now. Basically, my LinkButton is giving me a 'Event' is null or not an object" Javascript error message, and I don't know how to fix it.

If so, can you share with me how you fixed it. Thanks!


lnong
lnong is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic LinkButton not working in ASP.NET tapasmahata Software 0 03-14-2008 05:44 AM
Re: Weird problems mhaase-at-springmind.com A+ Certification 1 02-18-2005 01:58 AM
Re: Weird problems Danny Kile A+ Certification 0 02-16-2005 01:47 PM
Re: Weird problems D V. Brown A+ Certification 0 02-16-2005 12:33 PM
Last days of Something Weird Auctions KING B MAN DVD Video 0 05-29-2004 09:33 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46